MySQL最简单的安装过程

本文提供了一种简单的MySQL安装步骤,包括下载、创建用户与组、解压、安装、配置、启动及登录等环节,并介绍了如何设置MySQL随系统启动。
鼎鼎大名的数据库MySQL,最简单的安装过程如下:
1.下载:mysql-4.1.20.tar.gz( [url]www.mysql.org[/url]
2.//创建用户与组
[root@localhost root]#groupadd mysql
[root@localhost root]#useradd -g mysql mysql       
3.//解压
[root@localhost root]#tar zxvf mysql-4.1.20.tar.gz   
4.//安装
[root@localhost root]#cd mysql-4.1.20
[root@localhost mysql-4.1.20]# mkdir /opt/mysq
[root@localhost mysql-4.1.20]# ./configure --prefix=/opt/mysql
[root@localhost mysql-4.1.20]# make
[root@localhost mysql-4.1.20]# make install
5.//配置
[root@localhost mysql-4.1.20]# cd support-files/
[root@localhost support-files]# cp my-medium.cnf /etc/my.cnf
[root@localhost support-files]# cd /opt/mysql/bin
[root@localhost bin]# ./mysql_install_db --user=mysql
[root@localhost bin]# cd ..
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql var
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# cd bin
[root@localhost bin]# ./mysqladmin -u root password 123456
6.//启动与登陆
[root@localhost bin]# ./mysqld_safe --user=mysql &
[root@localhost bin]# ./mysql -u root -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.1.20-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| mysql   |
| test   |
| test1   |
+----------+
3 rows in set (0.00 sec)

mysql> exit
Bye
7.//开机启动
  方法是将"/opt/mysql/bin/mysqld_safe --user=mysql &"

加入到"/etc/rc.local"文件中来实现随机启动.




     本文转自 kofstart 51CTO博客,原文链接:http://blog.51cto.com/kofstart/10926,如需转载请自行联系原作者


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值