安装mysql

 1 tar -zxf mysql-5.1.51-linux-i686-glibc23.tar.gz
2
3 mv /mysql-5.1.51-linux-i686-glibc23 /usr/local/mysql
4
5 cp /usr/loacal/mysql/support-files/my-large.cnf /etc/my.cnf
6
7 groupadd mysql
8
9 useradd mysql -g mysql
10
11 chown -R root.mysql /usr/local/mysql
12
13 cd /usr/local/mysql
14
15 ./scripts/mysql_install_db --user=mysql
16
17
18 vim /etc/my.cnf 找到log-bin=mysql-bin这一行,将其注释:
19 #log-bin=mysql-bin
20 #binlog_format=mixed
21 在client下加入
22 default-character-set=utf8 //显示中文
23 在mysqld下加入
24 default-character-set=utf8 //显示中文
25 max_allowed_packet = 64M //mysql限制包的大小
26
27 cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
28
29 启动mysql service mysql start
30
31 设置本地登录密码mysqladmin -u root password 888888
32
33 进入数据库 /usr/local/mysql/bin/mysql -uroot -p

posted @ 2011-10-12 12:58  菜鸟MM  阅读(203)  评论(0编辑  收藏  举报