Centos6.0 64位MySQL 5.6.11 CMake安装部署(二)
cnf
vi /etc/my.cnf
[mysqld] 下添加
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /usr/local/mysql/data/mysql.sock
pid-file = /usr/local/mysql/data/mysqld.pid
interactive_timeout=28800000
wait_timeout=28800000
lower_case_table_names=1
2.my.cnf mysql 初始化安装
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
3. 将 mysql 加入开机启动
chmod +x /etc/init.d/mysqld
vi /etc/init.d/mysqld (编辑此文件,查找并修改以下变量内容:)
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
添加mysqld服务
#chkconfig --add mysqld
#chkconfig --level 2345 mysqld on
4. 启动 mysql服务
service mysqld start
------------------------------------------------
启动 mysql 服务的时候报如下错误:
Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
解决方法:
mysql_install_db --user=mysql 重新初始化
数据库即可
----------------------------------------------------
5. 设置root帐号密码
[root@demo ~]# /usr/local/
mysql/bin/mysqladmin -uroot password root**
[root@demo ~]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.11 Source distribution
Copyright (c) 2000, 2013,
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.