64-bit CentOS5.6 install MySQL 5.5.11GA

Source: Internet
Author: User

1. Update and see if the current CentOS version is 5.6
Yum Update
Lsb_release-a

2. Download the file
Download bison-2.4.3.tar.gz to/usr/local/src
Download cmake-2.8.4.tar.gz to/usr/local/src
Download mysql-5.5.11.tar.gz to/usr/local/src

3. Update the required libraries
Yum install gcc gcc-c++-y
Yum Install Ncurses-devel-y

Cd/usr/local/src
Tar zvxf bison-2.4.3.tar.gz
CD bison-2.4.3
./configure
Make && make install

4. Install CMake (requires GCC gcc-c++ library)
Cd/usr/local/src
Tar zxvf cmake-2.8.3.tar.gz
CD cmake-2.8.3
./bootstrap
Make && make install

5. Creating directories, configuring users, and user groups
Groupadd MySQL
useradd-g MySQL MySQL
Mkdir-p/data/mysql
Chown-r Mysql:mysql/data/mysql

6. Install MySQL (requires CMake ncurses-devel Bison Library)
Cd/usr/local/src
Tar zvxf mysql-5.5.11.tar.gz
CD mysql-5.5.11
Cmake-dcmake_install_prefix=/opt/mysql-dmysql_datadir=/data/mysql-dwith_innobase_storage_engine=1-dwith_memory _storage_engine=1-dwith_myisam_storage_engine=1-dsysconfdir=/etc/-dwith_ssl=yes-ddefault_charset=utf8-ddefault _collation=utf8_general_ci-dwith_readline=on
Make && make install

7. Create a soft connection

Ln-s/opt/mysql/lib/lib*/usr/lib/

8. Configuring the MySQL Database

Cd/opt/mysql
./scripts/mysql_install_db--basedir=/opt/mysql/--datadir=/data/mysql--user=mysql

9. Set default using UTF8 encoding
CP./SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

Vi/etc/my.cnf
Add a row under [client]
Default-character-set = UTF8
Add a row under [Mysqld]
Character-set-server = UTF8

10. Set up the MySQL boot auto-start service
CP./support-files/mysql.server/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
Chkconfig--level 345 mysqld on

11. Modify the service configuration file
Vi/etc/rc.d/init.d/mysqld

Modify the following two items in the mysqld file according to your settings
Basedir=/opt/mysql
Datadir=/data/mysql

12. Start the MYSQLD service
Service mysqld Start

13. Initialize the database and modify the root password (the root initial password is empty)
./bin/mysql_secure_installation
Follow the instructions

14. After restarting CentOS, try to connect to MySQL with root
Mysql-u root-p

15. Check Status after successful login

Status

64-bit CentOS5.6 install MySQL 5.5.11GA

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.