PDA

View Full Version : mysql prompt




ed 07
Feb 21, 2007, 07:12 AM
Trying to get mysql prompt on my termial window.
<computer name>:~ ClareD$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Password:
Starting MySQL database server
So seemed to work ok there - so presume it's downloaded correctly
Then typed
<computer name>:~ ClareD$ sudo /ClareD/local/mysql/bin/mysql -u root
sudo: /ClareD/local/mysql/bin/mysql: command not found
usr=ClareD is that correct??
As you may be aware I'm a total beginner, have searched the net, dowloaded tutorials and manual's so any help would be sincerely greatly apreciated.
i'm working on a macbook version 10.4.8 and have installed mysql standard 5.0.27.
Cheers



pengu
Feb 21, 2007, 07:18 AM
/usr/ is a directory, it does not actually relate to your username. so you need to run /usr/local/mysql/bin/mysql -u root -p

without the -p switch you wont be prompted for a password.

ed 07
Feb 21, 2007, 07:35 AM
hey cheers that explains alot but tried entering new command and now getting a different error
<computer name>:~ ClareD$ sudo /usr/local/mysql/bin/mysql -u root -p
Password:
/usr/local/mysql/bin/mysql: /usr/local/mysql/bin/mysql: cannot execute binary file
clare-duggans-computer:~ ClareD$

Any ideas??

pengu
Feb 21, 2007, 07:45 AM
um. cant say i've had that before. a quick google came up with a few possibilities:


It's a corrupt file, and needs to be re-downloaded and/or installed
Its built for the wrong architecture (ie, an Intel build, on a PPC mac)
Space monsters have convinced Steven P Jobs that you are not worthy of mysql. lol.

ed 07
Feb 21, 2007, 08:59 AM
hey, downloaded mysql file and installed it again.
New error message now appearing as below
<computer name>:~ ClareD$ sudo /usr/local/mysql/bin/mysql -u root -pEnter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

Could really do with some help if you have any ideas how to get this resolved
Cheers

beefy23
Feb 21, 2007, 09:16 AM
hey, downloaded mysql file and installed it again.
New error message now appearing as below
<computer name>:~ ClareD$ sudo /usr/local/mysql/bin/mysql -u root -pEnter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

Could really do with some help if you have any ideas how to get this resolved
Cheers

it looks like the mysql server may not be running i.e. it's not started listening for connections. Yous should be able to start it by typing sudo /usr/local/mysql/bin/mysqld &

lazydog
Feb 21, 2007, 09:18 AM
Have you started the mysql server? If not try this:-

sudo /usr/local/mysql/bin/safe_mysqld
ctrl-z
bg

That should start the server and put it in the background.

You should then be able to type:-

/usr/local/mysql/bin/mysql mysql --user=root --password=xxxxxx

If that doesn't work you'll need to set the mysql root password. Use mysqladmin to do this.

b e n

ed 07
Feb 21, 2007, 09:28 AM
Hey, cheers for that, I loaded the MySqlStartupItem.pkg and using
"sudu /usr/local/mysql/bin/mysql -u root" and was able to get mysql prompt. Horray!!
BUT when entered -p at end of that statement for password below error is occuring

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Not sure how to set up password??

beefy23
Feb 21, 2007, 10:02 AM
Hey, cheers for that, I loaded the MySqlStartupItem.pkg and using
"sudu /usr/local/mysql/bin/mysql -u root" and was able to get mysql prompt. Horray!!
BUT when entered -p at end of that statement for password below error is occuring

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Not sure how to set up password??

Try the following Resetting Mysql Permissions (http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html)