Install MySQL 5 manually on Linux

Source: Internet
Author: User

The following articles mainly describe how to manually install MySQL 5 on Linux. In fact, it is not difficult to manually install MySQL 5 on Linux, as long as you have mastered the actual operation solution, the following describes the main content of the article.

1. Download "mysql()and php )))))-standard-5.0.27-linux-i686-icc-glibc23.tar.gz", and recommend the ICC version, which is said to improve the GCC performance by 10-20%

2. Copy to/usr/local/and decompress the file: tar zxvf mysql(and php ))))-standard-5.x...tar.gz

3. Add the user and group MySQL5 (the best combination with PHP ):

Groupadd MySQL (best combination with PHP)

Useradd-g MySQL (the best combination with PHP)

4. Create a symbolic connection:/usr/local ln-s MySQL (best combination with PHP)-standard-5.x... MySQL (best combination with PHP)

5. cd MySQL (the best combination with PHP). Change the current directory to/usr/local/MySQL (the best combination with PHP )/

6. Run the script to initialize the database:./scripts/MySQL (the best combination with PHP) _ install_db -- user = MySQL (the best combination with PHP)

7. Set permissions:

/Usr/local/MySQL (the best combination with PHP) chown-R root.

/Usr/local/MySQL (the best combination with PHP) chown-R MySQL (the best combination of 5 and PHP) data

/Usr/local/MySQL (the best combination with PHP) chgrp-R MySQL (the best combination with PHP)

8. Create and modify/etc/my. cnf as needed. Refer to the Configuration:

[MySQL (the best combination with PHP) d]

Set the default value to the INNODB table and support transactions:

 
 
  1. default-storage-engine=INNODB 

Set the default character set:

 
 
  1. default-character-set=utf8 

Disable bdb

 
 
  1. skip-bdb 

9. Start MySQL (the best combination with PHP ):

/Usr/local/MySQL (the best combination with PHP)/bin. /MySQL5 (the best combination with PHP) d_safe -- user = MySQL (the best combination with PHP )&

10. initialize the root password:

/Usr/local/MySQL (the best combination with PHP)/bin. /MySQL (the best combination with PHP) admin-u root-p password "password-of-root"

Enter password: <Enter the old password and press Enter>

11. log on to the root account to create a database:

/Usr/local/MySQL (the best combination with PHP)./MySQL (the best combination with PHP)-u root-p

 
 
  1. Enter password: password-of-root 

Create a new user:

 
 
  1. MySQL (best combination with PHP)> create user test identified by 'test-password ';

Create a new database:

MySQL5 (the best combination with PHP)> create database testdb;

Grant the test user the permission to access testdb from localhost:

MySQL (best combination with PHP)> grant all on testdb. * to test @ localhost;

Stop the MySQL (best combination with PHP) server:

/Usr/local/MySQL (the best combination with PHP)/bin./MySQL (the best combination with PHP) admin-u root-p shutdown

Enter password: password-of-root

STOPPING server from pid file/usr/local/MySQL5 (optimal combination with PHP)/data/debian. pid

Xxx MySQL (best combination with PHP) d ended

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.