mysql安装:
[root@lamp ~]# yum install mysql mysql-server mysql-devel
启动mysql服务:/etc/init.d/mysqld start
设置mysql密码:
直接使用”mysql”进入数据库模式,
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘newpassword’) WHERE user=’root';
mysql> FLUSH PRIVILEGES;
登陆
mysql -u root -p
Enter Password:
创建一个用户管理数据库
mysql > create database demo
mysql >GRANT ALL PRIVILEGES ON demo.* TO ‘guest’@’localhost’ IDENTIFIED BY ‘guest’ WITH GRANT OPTION;
mysql> UPDATE user SET Password=PASSWORD(‘guest’) WHERE user=’guest';
设置MySQL字符集,vi /etc/my.cnf
#MySQL字符集
default-character-set = utf8
character_set_server = utf8
[client]
default-character-set=utf8
参考:
http://www.leixuesong.cn/76
[root@lamp ~]# yum install mysql mysql-server mysql-devel
启动mysql服务:/etc/init.d/mysqld start
设置mysql密码:
直接使用”mysql”进入数据库模式,
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘newpassword’) WHERE user=’root';
mysql> FLUSH PRIVILEGES;
登陆
mysql -u root -p
Enter Password:
创建一个用户管理数据库
mysql > create database demo
mysql >GRANT ALL PRIVILEGES ON demo.* TO ‘guest’@’localhost’ IDENTIFIED BY ‘guest’ WITH GRANT OPTION;
mysql> UPDATE user SET Password=PASSWORD(‘guest’) WHERE user=’guest';
设置MySQL字符集,vi /etc/my.cnf
#MySQL字符集
default-character-set = utf8
character_set_server = utf8
[client]
default-character-set=utf8
参考:http://www.leixuesong.cn/76