Install MySQL under Linux

Source: Internet
Author: User

1. Download the appropriate version of the website https://dev.mysql.com/downloads/mysql/5.6.html#downloads

2. Extracting files

tar -zxvf mysql-5.6. -LINUX-GLIBC2.  A

3. Copy the extracted MySQL files to the system local software directory

CP mysql-5.6. -LINUX-GLIBC2. -x86_64/usr/local/mysql-r

4. Add user groups and users

-G MySQL MySQL

5.

To Install the database:

Go to install MySQL software directory: Execute command cd/usr/local/mysql

Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.

Install database: Executes the command./scripts/mysql_install_db--user=mysql

Modify the current directory owner as root User: Execute command chown-r root:root.

Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data

6. start the MySQL service and add the boot MySQL service:

Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory

Start MySQL service: Execute command service MySQL start

Execute command: ps-ef|grep mysql see MySQL service description started successfully

7. Error when changing password

To modify the root user password of MySQL, the root initial password is empty:

Execute command:./bin/mysqladmin-u root password ' password ', error at this time

Follow these methods: Https://www.cnblogs.com/gumuzi/p/5711495.html modified successfully

Other errors:

Err message : Error 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2)

workaround : Open/etc/my.cnf to see what directory the socket is configured in. "Socket=/var/lib/mysql/mysql.sock"

The path and "/tmp/mysql.sock" are inconsistent. Establish a soft connection: Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock

Reference: https://www.cnblogs.com/fnlingnzb-learner/p/5830622.html

Https://www.cnblogs.com/bookwed/p/5896619.html

Https://www.cnblogs.com/gumuzi/p/5711495.html

Install MySQL under Linux

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.