当前位置: 代码迷 >> MySQL >> Mysql这么建表
  详细解决方案

Mysql这么建表

热度:134   发布时间:2016-05-05 16:47:45.0
Mysql这样建表

数据库安装:yum -y install mysql-server

数据库启动:service mysqld restart


权限设置:mysql -uroot -p
use mysql;? update user set Password=PASSWORD('123456') where User='root';
GRANT ALL PRIVILEGES ON *.* TO root@"%.%.%.%" IDENTIFIED BY "123456";


use mysql;? update user set Password=PASSWORD('aaa123456') where User='yangweixu';
GRANT ALL PRIVILEGES ON *.* TO yang@"%.%.%.%" IDENTIFIED BY "aaa123456";


use mysql;? update user set Password=PASSWORD('9jiu123456_aa') where User='tlbb_9999_aa';
grant select, insert, update, delete on tlbbdb.* to tlbb_9999_aa@'%.%.%.%' IDENTIFIED BY "9jiu123456_aa";

use mysql;? update user set Password=PASSWORD('9jiu123456_xx') where User='tlbb_9999_xx';
grant select, insert, update, delete on tlbbdb.* to tlbb_9999_xx@'%.%.%.%' IDENTIFIED BY "9jiu123456_xx";

use mysql;? update user set Password=PASSWORD('9jiu123456_dd') where User='tlbb_9999_dd';
grant select, insert, update, delete on tlbbdb.* to tlbb_9999_dd@'%.%.%.%' IDENTIFIED BY "9jiu123456_dd";


flush privileges;
exit


安装驱动包:yum install -y mysql-connector-odbc

数据库自动启动:chkconfig --level 3 mysqld on

首先通过chkconfig命令看看MySQL在不在可管理的列表中,命令是:
chkconfig --list如果列表中没有mysqld这个,需要先用这个命令添加:
chkconfig --add mysqld
然后用这个命令设置开机启动:
chkconfig mysqld on

centos 5.8的,用5.6也行

  相关解决方案