[iyunv@web01 tools]# cd /application/mysql
[iyunv@web01 mysql]# chown -R mysql.mysql /application/mysql/
[iyunv@web01 mysql]# ls
COPYING README data include man scripts sql-bench
INSTALL-BINARY bin docs lib mysql-test share support-files
此步骤操作看到如下两个OK就代表安装完成了。
[iyunv@web01 mysql]# ./scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/
Installing MySQL system tables...
170823 21:00:53 [Note] /application/mysql//bin/mysqld (mysqld 5.5.49) starting as process 1756 ...
OK
Filling help tables...
170823 21:00:53 [Note] /application/mysql//bin/mysqld (mysqld 5.5.49) starting as process 1763 ...
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:
/application/mysql//bin/mysqladmin -u root password 'new-password'
/application/mysql//bin/mysqladmin -u root -h web01 password 'new-password'
Alternatively you can run:
/application/mysql//bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly 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 with mysql-test-run.pl
cd /application/mysql//mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
上面的安装就生成内部两个管理库:mysql和performance_schema
1
2
3
4
5
[iyunv@web01 mysql]# ll data/
total 12
drwx------ 2 mysql root 4096 Aug 23 21:00 mysql
drwx------ 2 mysql mysql 4096 Aug 23 21:00 performance_schema
drwxr-xr-x 2 mysql mysql 4096 Aug 23 20:46 test
做个调整
1
2
[iyunv@web01 mysql]# cd bin/
[iyunv@web01 bin]# less mysqld_safe
[iyunv@web01 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.49 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
这就表示成功了,quit退出mysql,再做一个调整
1
mysql> quit
调整如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[iyunv@web01 mysql]# ll support-files/
total 96
-rwxr-xr-x 1 mysql mysql 1153 Mar 1 2016 binary-configure
-rw-r--r-- 1 mysql mysql 4528 Mar 1 2016 config.huge.ini
-rw-r--r-- 1 mysql mysql 2382 Mar 1 2016 config.medium.ini
-rw-r--r-- 1 mysql mysql 1626 Mar 1 2016 config.small.ini
-rw-r--r-- 1 mysql mysql 773 Mar 1 2016 magic
-rw-r--r-- 1 mysql mysql 4691 Mar 1 2016 my-huge.cnf
-rw-r--r-- 1 mysql mysql 19759 Mar 1 2016 my-innodb-heavy-4G.cnf
-rw-r--r-- 1 mysql mysql 4665 Mar 1 2016 my-large.cnf
-rw-r--r-- 1 mysql mysql 4676 Mar 1 2016 my-medium.cnf
-rw-r--r-- 1 mysql mysql 2840 Mar 1 2016 my-small.cnf
-rwxr-xr-x 1 mysql mysql 839 Mar 1 2016 mysql-log-rotate
-rwxr-xr-x 1 mysql mysql 10880 Mar 1 2016 mysql.server
-rwxr-xr-x 1 mysql mysql 1061 Mar 1 2016 mysqld_multi.server
-rw-r--r-- 1 mysql mysql 1326 Mar 1 2016 ndb-config-2-node.ini
[iyunv@web01 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.49 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>