Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2832756
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: LINUX

2008-12-05 23:08:31

2.8 MySQL
2.8.1 编译安装MySQL
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql \
--datadir=/usr/local/mysql/data \
--with-charset=gbk \
--localstatedir=/usr/local/mysql/data \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
shell> make
shell> make install
 #cd /usr/local/mysql
 #bin/mysql_install_db --user=mysql
 
#chown -R root .
 #chown -R mysql data
 #chgrp -R mysql .
 #bin/mysqld_safe --user=mysql &
shell> /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
2.8.2 MySQL安装后步骤
[root@ mysql]# /usr/local/mysql/bin/mysqladmin -u root password 'redroot'
[root@ mysql]# cd bin
[root@ bin]# ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.67-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> DELETE FROM mysql.user WHERE User = '';
Query OK, 2 rows affected (0.00 sec)
mysql> UPDATE mysql.user SET Password = PASSWORD('redroot') WHERE User = 'root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> SELECT Host, User FROM mysql.user;
+-----------------+------+
| Host | User |
+-----------------+------+
| 127.0.0.1 | root |
| JLDJ-SPT-ICS-TV | root |
| localhost | root |
+-----------------+------+
3 rows in set (0.00 sec)
mysql> insert into mysql.user(Host, User) values('%', 'root');
Query OK, 1 row affected, 3 warnings (0.00 sec)
mysql> SELECT Host, User FROM mysql.user;
+-----------------+------+
| Host | User |
+-----------------+------+
| % | root |
| 127.0.0.1 | root |
| JLDJ-SPT-ICS-TV | root |
| localhost | root |
+-----------------+------+
4 rows in set (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR = PASSWORD('redroot');
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON *.* TO ;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
阅读(982) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~