Install mysql on mac and mysql on mac

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.