MYSQL安装步骤
Linux安装mysql——源码安装
-- (1)先安装cmake〔my -R mysql:mysql data
(2)
[root@ rhel5 mysql]# cp support-files/my- /etc/ //将mysql的启动效劳添加到系统效劳中
(3)创立系统数据库的表
[root@ rhel5 mysql]# cd /usr/local/mysql
[root@ rhel5 mysql]# scripts/mysql_install_db --user=mysql
(4)设置环境变量
[root@ rhel5~]# vi /root/.bash_profile
在PATH=$PATH:$HOME/bin添加参数为:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
[root@ rhel5~]#source /root/.bash_profile
(5)手动启动mysql
[root@ rhel5~]# cd /usr/local/mysql
[root@ rhel5 mysql]# ./bin/mysqld_safe --user=mysql & //启动MySQL,但不能停顿
启动日志写在此文件下:/usr/local/mysql/data/
关闭MySQL效劳
[root@ rhel5 mysql]# mysqladmin -u root -p shutdown //这里MySQL的root用户还没有配置密码,所以为空值。须要输入密码时,干脆点回车键即可。
(6)另一种简洁的启动mysql的方法(mysql已经被添加到系统效劳中)
[root@ rhel5~]# service start [root@ rhel5~]# service stop [root@ rhel5~]# service restart
假如上述吩咐出现: 未识别的效劳
那么可能mysql还没添加到系统效劳中,下面用另一种方法添加:
[root@ rhel5 mysql]# cp support-files/ /etc/ //将mysql的启动效劳添加到系统效劳中
留意:,命名为mysql。在有的系统中,
MYSQL安装步骤 来自淘豆网m.daumloan.com转载请标明出处.