yum install mysql
yum install mysql-server
yum install mysql-devel
chgrp -R mysql /var/lib/mysql
chmod -R 770 /var/lib/mysql

service mysqld start 
mysql
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('secret_password');



1.新建用户。

//登录MYSQL
@>mysql -u root -p
@>密码
//创建用户
mysql> insert into mysql.user(Host,User,Password) values("%","doctrack",password("idoladmin"));
//刷新系统权限表


GRANT ALL PRIVILEGES ON *.* TO 'doctrack'@'%' IDENTIFIED BY 'idoladmin' WITH GRANT OPTION; 
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码 
GRANT ALL PRIVILEGES ON *.* TO 'doctrack'@'192.168.1.3' IDENTIFIED BY 'idoladmin' WITH GRANT OPTION; 


mysql>flush privileges;




ODBC安装



yum install ftp://fr2.rpmfind.net/linux/centos/6.6/os/x86_64/Packages/mysql-connector-odbc-5.1.5r1144-7.el6.x86_64.rpm



MySQL错误:access denied for user 'root'@'localhost' using password yes


# /etc/init.d/mysqld stop  

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &  

# mysql -u root mysql  

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;  

mysql> FLUSH PRIVILEGES;  

mysql> quit  

# /etc/init.d/mysqld restart  

# mysql -uroot -p  

Enter password: <输入新设的密码newpassword>  

mysql>