Install Mysql_mysql on Mac OS X

Source: Internet
Author: User

I found an article on the internet, it is almost an artifact.

Just started with brew search MySQL ... Can find, follow the prompts step-by-step installation, the result is not start up, the old hint of a sock related errors.

Later, I went directly to the MySQL website to download the MYSQL-5.5.17-OSX10.6-X86_64.DMG for the Mac platform

3 files found after opening, order of installation:

1. MYSQL-5.5.17-OSX10.6-X86_64.PKG Database
2. Mysqlstartupitem.pkg this way, MySQL automatically starts automatically when it is powered on.
3. Mysql.prefpane this will be in the "system Preferences" to see the name "MySQL" icon, through which you can set MySQL to start or stop, and whether the boot automatically run. MySQL is basically installed here.

Add MySQL and mysqladmin aliases to bash's configuration file by running "sudo vi/etc/bashrc"

#mysql

Alias mysql= '/usr/local/mysql/bin/mysql '

Alias mysqladmin= '/usr/local/mysql/bin/mysqladmin '

This can be more simple in the terminal through the command to do the appropriate operation, such as after the installation of the MySQL root default password is empty, if you want to set the password can run in the terminal "Mysqladmin-u root password" Mysqlpassword "" to set, Where Mysqlpassword is the password of root.

Note: Using PHP to connect MySQL may error "can" T connect to the local MySQL server through socket '/var/mysql/mysql.sock ', Or use localhost cannot connect MySQL and need 127.0.0.1, because the connection time PHP default to find/var/mysql/mysql.sock, but the Mac version of MySQL changed the location of the file, placed in/tmp. The approach is to modify the php.ini as follows:
Mysql.default_socket =/tmp/mysql.sock

Above said, did not have a nonsense, very admire!

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.