Environment:
Linux |
CentOS6.8 |
Epel |
Http://mirrors.aliyun.com/repo/Centos-6.repo |
Mysql |
Mysql-5.5.49.tar.gz |
Kernel |
2.6.32-642.el6.x86_64 |
This machine Ip |
10.0.0.51 |
1.Install dependent packages
[Email protected] tools]# yum-y install gcc cmake ncurses-devel cmakencurses-devel libxml2-devel libtool-ltdl-devel gcc- C + + autoconf Automake bisonzlib-devel
2.Upload Source Package
[[email protected] ~]# mkdir-p/application/[[email protected] ~]# mkdir-p/server/tools[[email protected] ~]# Cd/serve R/tools[[email protected] tools]# rz[ro[email protected] tools]# tar xf mysql-5.5.49.tar.gz [[email protected] tools]# CD mysql-5.5.49
3.Compiling the installation
CMake. -dcmake_install_prefix=/application/mysql-5.5.49-dmysql_datadir=/application/mysql-5.5.49/data-dmysql_unix_ Addr=/application/mysql-5.5.49/tmp/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dextra_ Charsets=gbk,gb2312,utf8,ascii-denabled_local_infile=on-dwith_innobase_storage_engine=1-dwith_federated_ Storage_engine=1-dwith_blackhole_storage_engine=1-dwithout_example_storage_engine=1-dwithout_partition_storage _engine=1-dwith_fast_mutexes=1-dwith_zlib=bundled-denabled_local_infile=1-dwith_readline=1-dwith_embedded_ Server=1-dwith_debug=0
Tip, there are many options to configure at compile time, specifically refer to the official documentation:
Make
#[100%] Built Target my_safe_process
Make install
4.Soft Connection
Ln-s/application/mysql-5.5.49//application/mysql
If there is no error in the above operation, the installation of MySQL5.5.49 software CMake mode is successful.
Check:
[Email protected] mysql-5.5.49]# ln-s/application/mysql-5.5.49//application/mysql[[email protected] mysql-5.5.49]# Ll/application/total 4lrwxrwxrwx 1root root 18:25 mysql->/application/mysql-5.5.49/drwxr-xr-x root ro OT 4096 Nov 18:25mysql-5.5.49[[email protected] mysql-5.5.49]# echo $?0
5.Initialize
[[email protected] ~]# /application/mysql/scripts/mysql_install_db --basedir=/application/ Mysql/ --user=mysqlinstalling mysql system tables ... 161111 18:35:25 [note] /application/mysql//bin/mysqld (mysqld 5.5.49) starting as  PROCESS 14060&NBSP, ..... Okfilling help tables ... 161111 18:35:25 [note]/application/mysql//bin/mysqld (mysqld 5.5.49) starting as  PROCESS 14067&NBSP, ..... ok to start mysqld at boot time you have to Copysupport-files/mysql.server to the right place foryour system please remember to set a password for the mysqlroot user ! To do so, start the server, then issue thefollowing commands: /application/mysql//bin/mysqladmin -u root password ' New-password '/application/mysql//bin/mysqladmin -u root -h db01password ' New-password ' alternatively you can run:/application/mysql//bin/mysql_secure_installation which Will also give you the option of removing thetestdatabases and anonymous user created bydefault. This isstrongly recommended For production servers. see the manual for more instructions. you can start the mysql daemon with:cd /application/mysql/ ;/application/ mysql//bin/mysqld_safe & you can test the mysql daemon Withmysql-test-run.plcd /application/mysql//mysql-test ; perlmysql-test-run.pl please report any problems athttp://bugs.mysql.com/
6. Copy the configuration file toetcdirectory under
[Email protected] ~]#/BIN/CP/APPLICATION/MYSQL/SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF
7. CreateMysqluser and set directory permissions
[Email protected] ~]# useradd-s/sbin/nologin mysql-m[[email protected] ~]# chown-r mysql.mysql/application/mysql/[[e Mail protected] ~]# ls-l/application/mysql/
8. Add/etc/init.d/mysql file
[Email protected] ~]#/bin/cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld
9.start MySQL
[Email protected] ~]#/etc/init.d/mysqld startstarting MySQL. success! [Email protected] ~]# ss-lntup|grep mysqltcp LISTEN 0 *:3306 *:* Users: (("mysqld", 14328,10))
[Email protected] ~]# chkconfig mysqld on[[email protected] ~]# chkconfig--list mysqldmysqld 0:off 1:off 2:o n 3:on 4:on 5:on 6:off
10.adding environment variables and booting from
[[Email protected] ~] #PATH = "$PATH:/application/mysql/bin" [[email protected] ~]# echo ' path= ' $PATH:/application/mysql /bin "' >>/etc/profile[[email protected] ~]#. /etc/profile
This article is from "Song Someone C" blog, please be sure to keep this source http://syaving.blog.51cto.com/5614476/1878661
MySQL Installation--"2"