-- remove old
yum remove mysql mysql-*
-- download
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/
-- install
rpm -ivh MySQL-server-5.5.30-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.5.30-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.5.30-1.el6.x86_64.rpm
rpm 安装的mysql 服务名不叫mysqld, 叫mysql. 所以 services mysql restart
-- make service
cp /usr/share/mysql/mysql.server /etc/init.d/mysqld
cd /etc/init.d/
chkconfig --add mysqld
chkconfig mysqld on
service mysqld restart
-- test
service mysqld start
mysqladmin -uroot password '1qaz'
-- update
service mysqld start
mysql_upgrade
-- config
/usr/share/mysql/my-huge.cnf
自动启动:
察看mysql是否在自动启动列表中 /sbin/chkconfig --list
把MySQL添加到你系统的启动服务组里面去 /sbin/chkconfig --add mysql
把MySQL从启动服务组里面删除 /sbin/chkconfig --del mysql
配置
将/usr/share/mysql/my-medium.cnf复制到/etc/my.cnf,以后修改my.cnf文件来修改mysql的全局设置
将my.cnf文件中的innodb_flush_log_at_trx_commit设成0来优化
[mysqld]
后添加添加lower_case_table_names设成1来不区分表名的大小写
设置字符集
MySQL的默认编码是Latin1,不支持中文,要支持需要把数据库的默认编码修改为gbk或者utf8。
1、中止MySQL服务(bin/mysqladmin -u root shutdown)
2、在/etc/下找到my.cnf,如果没有就把MySQL的安装目录下的support-files目录下的my-medium.cnf复制到/etc/下并改名为my.cnf即可
3、打开my.cnf以后,在[client]和[mysqld]下面均加上default-character-set=utf8,保存并关闭
4、启动MySQL服务(bin/mysqld_safe &)
查询字符集:show variables like '%set%';
sever
database
-- auth
grant all privileges on *.* to root@'192.168.3.68' identified by '1qaz' with grant option;
flush privileges;
阅读(607) | 评论(0) | 转发(0) |