二进制方式快速安装MySQL数据库命令集合
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
1.安装mysql ls mysql-5.5.32-linux2.6-x86_64. tar .gz tar xf mysql-5.5.32-linux2.6-x86_64. tar .gz mv mysql-5.5.32-linux2.6-x86_64 /application/mysql-5 .5.32 ln -s /application/mysql-5 .5.32 /application/mysql ##########相当于编译步骤的make install完成############# 2.创建用户和目录 useradd mysql -s /sbin/nologin -M chown -R mysql.mysql /application/mysql/data/ 3.初始化数据库 cd /application/mysql . /scripts/mysql_install_db --user=mysql --basedir= /application/mysql --datadir= /application/mysql/data/
cp support-files /my-small .cnf /etc/my .cnf cp support-files /mysql .server /etc/init .d /mysqld chmod +x /etc/init .d /mysqld sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init .d /mysqld /etc/init .d /mysqld start netstat -lntup| grep mysql cp -a /application/mysql/bin/ * /usr/local/sbin/ mysqladmin password oldboy123 mysql -uroot -poldboy123
|