数据服务中心搭建
1.初始化数据库
1 sudo yum -y remove mysql #卸载数据库 2 sudo yum -y install mysql #重新安装官方稳定版本mysql; 3 sudo vim /etc/my.cnf #修改配置文件,更新数据存放目录
#datadir=/var/lib/mysql
datadir=/Date/data/mysql
登陆数据库设置账号密码
mysql -u root
set password for 'root'@'localhost' = password('abcd@1234');
Query OK, 0 rows affected (0.00 sec)
账号权限
mysql> grant all on *.* to 'root'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT GRANT OPTION ON *.* TO 'sftest'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'sftest'@'%'; Query OK, 0 rows affected (0.00 sec)
忘记密码
UPDATE user SET Password = password ( 'sf2admin1123' ) WHERE User = 'root' ;
公众号请关注:侠之大者