MYSQL5.5 Manual compilation of the installation process

Source: Internet
Author: User
Tags manual mkdir

Manual Compile installation of MYSQL5.5

Installation methods are divided into RPM and source code compiled two kinds of installation, this article is the use of MySQL source compiler, compiler use CMake. The software needs mysql-5.5.40.tar.gz and cmake-2.8.10.2.tar.gz, please download it yourself.

Download Address:

Http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.40.tar.gz

Http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz

Where MySQL uses the latest stable version, that is, the last version of the latest beta, and non-RC or alpha version, CMake directly with the latest version.

"Upload mysql-5.5.40.tar.gz and cmake-2.8.10.2.tar.gz to the/usr/java/tools folder.

"CentOS installs g++ and Ncurses-devel

# yum-y Install gcc-c++

"Installation of CMake

# mkdir-p/usr/java/make #
Cd/usr/java/make #
mv. /tools/cmake-2.8.10.2.tar.gz./
# tar-zxv-f cmake-2.8.10.2.tar.gz 
# cd cmake-2.8.10.2
#/configure
# make

To permanently add cmake to system environment variables
"VI in the file/etc/profile file to add variables to make it permanent and effective,

Add the MAKE_PATH environment variable to the file path:

java_home=/usr/java/jdk1.7.0_79
Jre_home=/usr/java/jdk1.7.0_79/jre
make_path=/usr/java/cmake/ Cmake-2.8.10.2/bin
path= $MAKE _path: $PATH: $JAVA _home/bin: $JRE _home/bin classpath=
: $JAVA _home/lib/dt.jar : $JAVA _home/lib/tools.jar: $JRE _home/lib
export java_home jre_home PATH CLASSPATH

"Executes the following code to make the changes in effect:

Use the Export command to view the value of the path

"Create MySQL installation directory and database storage directory

# mkdir-p/usr/java/mysql//install MySQL

"Create a MySQL user and user group

# groupadd MySQL
# useradd-r-G MySQL MySQL

"Compile and install MySQL

# cd/usr/java/mysql
# tar zxvf. /tools/mysql-5.5.40.tar.gz 
# cd mysql-5.5.40/
# cmake-dcmake_install_prefix=/usr/java/mysql \
-dmysql_unix_addr=/usr/java/mysql/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general _CI \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \ 
-dwith_memory_storage_ engine=1 \ 
-dwith_readline=1 \
-denabled_local_infile=1 \ 
-dmysql_datadir=/usr/java/mysql/data \ 
- Dmysql_user=mysql \ 
-dmysql_tcp_port=6666
# make

"Verify that the installation is successful

# CD  
[Root@fiona mysql]# ls 
bin      data  include         Lib  mysql-5.5.40  mysql-test  Scripts  Sql-bench
Copying  docs  install-binary  man  mysql.sock    README      share    support-files

There are bin and other documents, congratulations you have successfully installed MySQL.

"Configure MySQL

"Set MySQL directory permissions

# Cd/usr/java/mysql//The owner of all files in the current directory is set to root, and the owning group is MySQL
# chown-r Root:mysql. 

To add the MySQL startup service to the system service

# CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF 

Create a table for the system database

# Cd/usr/java/mysql 

"Set Environment variables

# Vi/root/.bash_profile
Re-Modify the path= $PATH: $HOME/bin:
path= $PATH: $HOME/bin:/usr/java/mysql/bin:/usr/java/mysql/lib

"Manually start MySQL

#./bin/mysqld_safe--user=mysql &/Start MySQL, but can't stop

To add the MySQL startup service to the system service

"Start MySQL

# service MySQL Start
 Starting MySQL ... error! The server quit without updating PID file (/usr/java/mysql/data/localhost.localdomain.pid).

"Failed to start:
"I am here to issue permission, first change the permissions

"Then start the server

"Modify the password of the MySQL root user and open the remote connection

mysql> use MySQL;
mysql> desc user;
Mysql> GRANT all privileges in *.* to root@ "%" identified by "root"; Ability to add remote connections to root
mysql> Update user Set Password = Password (' x123456. ') where user= ' root ';//set root password
Mysql> Select Host,user,password from User where user= ' root ';
mysql> flush Privileges;

"Re-Login

# mysql-u Root-p
 

If you are unable to connect remotely, turn off the firewall

 

Connected with a remote tool indicates success.

Source: http://blog.csdn.net/yougoule/article/details/54014792

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.