CentOS6.8 x86_64bit Source Installation MySQL-5.5.47

Source: Internet
Author: User

mysql-5.5.47 Installation

1. Download the source package in advance or enter the server to upload the source package and extract it.
Cd/home/rich/tools
Rz-y "Mysql-5.5.47-linux2.6-x86_64.tar.gz"
Tar XF mysql-5.5.47-linux2.6-x86_64.tar.gz

2. Create an administrative user for the MySQL database and check
Useradd-s/sbin/nologin mysql-m
ID MySQL

3. Move or copy the extracted source package to a directory that is easy to manage and create a link to the software
MV mysql-5.5.57-linux-glibc2.12-i686/application/mysql-5.5.57
Ln-s/application/mysql-5.5.57//application/mysql

4. mysql Admin directory for authorized users
Cd/application/mysql
Chown-r mysql.mysql/application/mysql/

5. Enter MySQL directory to start initializing the database
./scripts/mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/data/--user=mysql

6. More busy starting the default startup directory for script files
cd/application/mysql/bin/
Sed-i ' S#/usr/local/#/application#g ' Mysqld_safe

7. Copy the MySQL configuration file my.cnf to the configuration directory of the server
Cd/application/mysql
\CP support-files/my-small.cnf/etc/my.cnf

8. The MySQL database cannot be started by entering MySQL directly on the command line because of the environment variable, so specify the MySQL startup directory file to the server's environment variable
Vi/etc/profile//Edit the boot-up configuration file
Path= "/application/mysql/bin: $PATH" >>/etc/profile//Add MySQL startup directory file to environment variable
. /etc/profile//Command line execution takes effect

9. Modify the MySQL Custom installation directory in the startup script
Cd/application/mysql
Sed-i ' s#/usr/local#/application/#g ' support-files/mysql.server

10. Copy the startup script to the server's startup script directory and rename it to Mysqld
CP Support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld//Add executable permissions for MYSQLD

11. Start and stop the MySQL database
/etc/init.d/mysqld start
/etc/init.d/mysqld stop

12. Check if MySQL started successfully
Lsof-i: Default port for 3306//mysql 3306

13. Add Mysqld to boot from
Chkconfig--add mysqld

14. Create a login password for MySQL data and login with a password
Mysqladmin Password 123456
Mysql-uroot-p ' 123456 '

CentOS6.8 x86_64bit Source Installation MySQL-5.5.47

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.