Install MYSQL and osmysql on MAC OS X

Source: Internet
Author: User

Install MYSQL and osmysql on MAC OS X

I found an article on the Internet, which is really an artifact.

You can find it at the beginning by using brew search mysql... and follow the prompts to install it step by step. The final result is that it cannot be started, and a sock-related error is always prompted ..

Later I went directly to the mysql official website to download the mysql-5.5.17-osx10.6-x86_64.dmg for MAC Platform

3 files are found after opening. installation sequence:

1. Mysql-5.5.17-osx10.6-x86_64.pkg Database
2. MySQLStartupItem. pkg so that MySQL will automatically start at startup.
3. MySQL. prefPane will see the ICON "MySQL" in "system setting Preferences", through which you can set whether MySQL starts or stops and whether it runs automatically at startup. MySQL is basically installed.

Run "sudo vi/etc/bashrc" and add the alias of mysql and mysqladmin to the bash configuration file.

# Mysql

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

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

In this way, you can perform operations through commands in the terminal. For example, after installation, the default MySQL root Password is blank, to set the password, Run "mysqladmin-u root password" mysqlpassword "on the terminal. mysqlpassword is the root password.

Note: If you use PHP to connect to MySQL, the error "Can't connect to local MySQL server through socket"/var/mysql may be reported. sock ', or use localhost to connect to MySQL and 127.0.0.1 is required because/var/mysql/MySQL is used by default in php connection. sock, but MYSQL of MAC version changes the file location, put it under/tmp. The solution is to modify php. ini as follows:
Mysql. default_socket =/tmp/mysql. sock

The above is not a nonsense and I really admire it!


How to install MySQL in Mac OS X?

Go to MYSQL.com to download the version of the system, and then install
Dev.mysql.com/..n.html

How to install MySQL in Mac OS X?

I am not sure about this. You can search Baidu.
 

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.