Install mysql on mac and mysql on mac
Install mysql and check
1. Download the dmg installation package from the mysql website
2. After the download is complete, double-click the installation package and click Next step. The default setting is standard installation. You can also customize the installation before the installation is complete.
3. Enter mysql -- version on the terminal and the command not found prompt will be displayed.
The solution is to run the following two commands:
Cd/usr/local/bin/
Sudo ln-fs/usr/local/mysql/bin/mysql
4. Enter mysql -- version to print out the mysql version.
Start mysql (start mysql in safe mode ):
1. sudo/usr/local/mysql/bin/mysqld_safe -- skip-grant-tables
2. Enter the command in another terminal Tab
Ps-ef | grep mysql
Localhost: bin fujunmin $ ps-ef | grep mysql
We can see that the mysql service has been started.
3. Enter mysql
Mysql-u root
Skip the password and press enter to enter mysql.
# The default mysql password is root, but if it is connected in the code, it will find that the connection fails. mysql requires us to change the password and run the command to change the password:
Mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root ';
4. Stop the mysql service:
Sudo/usr/local/mysql/support-files/mysql. server stop
When you terminate the service, you will be asked to enter the password and the modified password.
Localhost :~ Fujunmin $ sudo/usr/local/mysql/support-files/mysql. server stop
Localhost :~ Fujunmin $ sudo/usr/local/mysql/support-files/mysql. server start
View comments