Original: Install mysql live broadcast in the Linux system, and use linuxmysql
[Root @ web108 tools] #### start to install mysql
1. Add a user
[Root @ web108 tools] # useradd-s/sbin/nologin-M mysql
2. Decompress
[Root @ web108 tools] # tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
[Root @ web108 tools] # echo $?
0
3 move mysql
[Root @ web108 tools] # mv mysql-5.6.34-linux-glibc2.5-x86_64/application/mysql-5.6.34
[Root @ web108 tools] # ll
Total 306792
-Rw-r -- 1 root 314149697 Sep 13 mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
-Rw-r -- 1 root 607 Sep 11 09:50 quanwangweb. sh
[Root @ web108 tools] # cd/application/
[Root @ web108 application] # cd mysql-5.6.34/
[Root @ web108 mysql-5.6.34] # cd ..
4. Create a soft connection
[Root @ web108 application] # ln-s/application/mysql-5.6.34/application/mysql
[Root @ web108 application] # ll
Total 8
Lrwxrwxrwx 1 root 25 Sep 13 mysql->/application/mysql-5.6.34
Drwxr-xr-x 13 root 4096 Sep 13 10:19 mysql-5.6.34
Lrwxrwxrwx 1 root 25 Sep 12 nginx->/application/nginx-1.10.2
Drwxr-xr-x 11 root 4096 Sep 12 nginx-1.10.2
[Root @ web108 application] # id mysql
Uid = 502 (mysql) gid = 502 (mysql) groups = 502 (mysql)
5. Manage mysql users
[Root @ web108 application] # chown-R mysql. mysql/application/mysql/
[Root @ web108 application] # ll/application/mysql
Lrwxrwxrwx 1 mysql root 25 Sep 13/application/mysql->/application/mysql-5.6.34
[Root @ web108 application] # ll/application/mysql/
Total 68
Drwxr-xr-x 2 mysql 4096 Sep 13 bin
-Rw-r -- 1 mysql 17987 Sep 30 2016 COPYING
Drwxr-xr-x 3 mysql 4096 Sep 13 data
Drwxr-xr-x 2 mysql 4096 Sep 13 docs
Drwxr-xr-x 3 mysql 4096 Sep 13 include
Drwxr-xr-x 3 mysql 4096 Sep 13 lib
Drwxr-xr-x 4 mysql 4096 Sep 13 man
Drwxr-xr-x 10 mysql 4096 Sep 13 mysql-test
-Rw-r -- 1 mysql 2496 Sep 30 2016 README
Drwxr-xr-x 2 mysql 4096 Sep 13 scripts
Drwxr-xr-x 28 mysql 4096 Sep 13 share
Drwxr-xr-x 4 mysql 4096 Sep 13 SQL-Scripts
Drwxr-xr-x 2 mysql 4096 Sep 13 support-files
6. install the software to initialize the database.
[Root @ web108 application] #/application/mysql/scripts/mysql_install_db -- basedir =/al_install_db -- basedir =/application/mysql -- datadir =/application/mysql/data -- user = mysql
[Root @ web108 application] # echo $?
0
[Root @ web108 application] # ll-d/tmp/
Drwxrwxrwt. 3 root 4096 Sep 13 10: 40/tmp/
[Root @ web108 application] # chmod 1777/tmp/
7. Copy STARTUP script authorization
[Root @ web108 application] # cp/application/mysql/support-files/mysql. server/etc/init. d/mysqld
[Root @ web108 application] # chmod + x/etc/init. d/mysqld
[Root @ web108 application] # cd/server/tools/
8. Modify the path in the startup script and mysql command.
[Root @ web108 tools] # sed-I's #/usr/local/mysql #/application/mysql # G'/application/mysql/bin/mysqld_safe/etc/init. d/mysqld
9 copy the default configuration file
[Root @ web108 tools] # \ cp/application/mysql/support-files/my-default.cnf/etc/my. cnf
10 start mysql
[Root @ web108 tools] #/etc/init. d/mysqld start
Starting MySQL... SUCCESS!
[Root @ web108 tools] #