A set MySQL command line search path 0. The bottom point of the system Preferences, Apple, MySQL start MySQL service on the pop-up page 1. Open terminal, input: sudo vi ~/.bash_profile if already deleted: sudo rm-rf. bash_* 2. Input i 3. Then stick Paste the following content # Mysqlalias mysql= '/usr/local/mysql/bin/mysql ' Alias mysqladmin= '/usr/local/mysql/bin/mysqladmin ' # Lsalias ls= ' Ls-g ' 4. Press ESC 5. Enter: Wq6. Restart Terminal program two MAC new installed MySQL cannot log on to root user workaround
When MySQL is installed on the MacBook Pro, an error occurs when you execute mysqladmin to set the password for the root account.
Mysqladmin:connect to server at ' localhost ' failed
Error: ' Access denied for user ' root ' @ ' localhost ' (using Password:no) '
1: The bottom point of apple---system preferences, MySQL turn off MySQL service in the pop-up page
2: Enter terminal
Input: Cd/usr/local/mysql/bin
3. Login administrator rights after enter
sudo su
4. Enter the following command to disable the MySQL authentication function after carriage return
./mysqld_safe--skip-grant-tables &
--skip-grant-tables: Do not start grant-tables (authorization table), skip permission control.
--skip-networking: Skipping the TCP/IP protocol, only native access (this option is not required.) Can not be used)
5. Change Password:
mysql> Update Mysql.user Set Authentication_string=password (' 123456 ') where user= ' root ';
mysql> flush Privileges;
Newly installed MySQL under Mac cannot log on to root user solution