Install MySQL 5.5.9 on centos

Source: Internet
Author: User

Due to development needs, MySQL 5.5.9 needs to be installed and installed now. There are always errors when rpm is used, and there are still a lot of troubles related to the issue. In addition, no Binary Package is found, I had to find the source code package for compilation;

[Root @ linuxidc www.linuxidc.com] # uname-
Linux test 2.6.18-194. EL5 #1 SMP Fri APR 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

First, download and install cmake;
Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
Install cmake;
Tar xvzf cmake-2.8.4.tar.gz
./Configure
Make
Make install
Download MySQL and go to the official website to find what you need;
Wget ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz
Compile and install MySQL
CD mysql5.5.9
Rm cmakecache.txt
Cmake .\
-Dcmake_install_prefix =/usr/local/MySQL /\
-Dmysql_datadir =/usr/local/MySQL/data \
-Dwith_innobase_storage_engine = 1 \
-Dmysql_tcp_port = 3306 \
-Dmysql_unix_addr =/usr/local/MySQL/data/MySQL. Sock \
-Dmysql_user = MySQL \
-Dwith_debug = 0
I reported an error during compilation, which means that dmysql_user = MySQL is invalid and I am too lazy to find the cause. I removed the parameter directly and then perform the following operations;
Make & make install

After installation, go to the MySQL installation directory.

CD/usr/local/MySQL
CP support-files/my-huge.cnf/etc/My. CNF
VI/etc/My. CNF

I have hardly changed the PATH value set for you to change the data directory and socket file.

Now you need to change the permission;
Chown MYSQL: MySQL/etc/My. CNF
Chown-r MYSQL: MySQL/usr/local/MySQL

Switch the user to the installation directory
Su-MySQL
CD/usr/local/MySQL/scripts
./Mysql_install_db

Start MySQL
Bin/mysqld_safe &

View the port;
[Root @ linuxidc www.linuxidc.com] # netstat-an | grep 3306
TCP 0 0: 3306: * listen
[Root @ linuxidc www.linuxidc.com] # ps aux | grep MySQL | grep-V 'grep'
MySQL 15747 0.0 0.0 63828 1268 pts/3 S/bin/sh./mysqld_safe
MySQL 15985 0.0 5.5 765088 114340 pts/3 SL/usr/local/MySQL/bin/mysqld -- basedir =/usr/local/MySQL -- datadir =/usr/local/MySQL /data -- Plugin-Dir =/usr/local/MySQL/lib/plugin -- log-error =/usr/local/MySQL/data/test. err -- PID-file =/usr/local/MySQL/data/bailianweb64.pid -- socket =/usr/local/MySQL/data/MySQL. sock -- Ports = 3306
Root 16031 0.0 0.1 92996 2416 pts/4 S +./MySQL

Set phpMyAdmin as follows. 10 thousand words are omitted here ......

OK. This operation is complete!

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
Support-files/MySQL. Server to the right place for your system

Please remember to set a password for the MySQL Root User!
To do so, start the server, then issue the following commands:

./Bin/mysqladmin-u Root Password 'new-password'
./Bin/mysqladmin-u root-H localhost. localdomain password 'new-password'

Alternatively you can run:
./Bin/mysql_secure_installation

Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon:
CD ..;./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
CD./MySQL-test; Perl mysql-test-run.pl

Please report any problems with the./bin/mysqlbug script!

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.