数据库安装: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也行