I've just set up MySQL on my computer (OS X 10.7), and it seems to be working, judging by the "mysqld" in the activity monitor and the new icon in my System Preferences.
However I'm having trouble doing anything with MySQL, as I need to login at least as the root user, but it doesn't let me. So let's run through what I've been doing and what error messages I'm getting:
Firstly, I start up MySQL via the "mysql" unix executable file. This seems to work, as my entries are now preceded with
CREATE DATABASE books;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'books'
mysql -u root -p;
At the OSX Terminal prompt you enter
mysql -u root to actually start the command line client that connects to the server.
You do not enter this in after you have already typed
mysql at the command line prompt.
Here is an example session:
shell> mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd'); mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd'); mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('newpwd'); mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
NOTE: you might need to preface the
shell> mysql -u root with
shell> sudo mysql -u root
shell> represents whatever your shell prompt actually looks like.
[jhr@Blackintosh] [/usr/local/mysql-5.5.25a-osx10.6-x86_64/bin] ./mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.5.25a MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
My shell prompt is customized to be
[jhr@Blackintosh] [/usr/local/mysql-5.5.25a-osx10.6-x86_64/bin] so
./mysql -u root it typed at the shell prompt. The rest is what the output of that command should be. The shell prompt is replaced by the prompt of the
mysql program prompt.