操作系统CentOS,apache2.2.4,数据库Mysql-5.0.18。使用mysql源码包进行安装,也可以使用mysql二进制包安装或者rpm包安装。1。增加一个登录用户和群组: # groupadd mysql #useradd -g mysql mysql2。解压mysql-5.0.18.tar.gz到/usr/local/mysql #tar -zvxf mysql-5.0.18,tar.gz3。进入mysql-5.0.18目录 #cd mysql-5.0.184。运行configure编译mysql源码 #./configure --prefix=/usr/local/mysql/5。安装mysql到指定的目录 #make;make install6。把/support-files/my-medium.cnf复制到/etc/下 #cp ./support-files/my-medium.cnf /etc/my.cnf7。在还没有安装mysql数据库之前,还必须为mysql建立授权表: #/scripts/mysql_install_db --user=mysql&注:也可以使用root,但是--user须改为-user8。修改相应文件的权限(/usr/local/mysql/) #chown -R root /usr/local/mysql #chown -R mysql /usr/local/mysql #chown -R mysql /usr/local/mysql/var9。启动mysql:(/usr/local/mysql/) # ./bin/mysqld_safe --user=mysql&10。安装后mysql数据库的root帐户密码默认为空,可以这样修改: # /usr/local/mysql/bin/mysqladmin -u root -password "new-password"11。把mysql命令加入到环境变量 # echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile #source /etc/profile //使环境变量生效 #echo $PATH //输出环境变量/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/mysql/bin
12。开机时启动mysql,把mysql.server放到开机启动的文件中/etc/init.d/mysql:(/usr/local/src/目录下) #cp ./mysql-5.0.18/support-fiels/mysql.server /etc/init.d/mysql #chkconfig --add mysql #chkconfig mysql on13。登录mysql:(必须把mysql命令加入到环境变量中) # mysql -u root -p12345
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 4 to server version: 5.0.18-logType "help;" or "h" for help. Type "c" to clear the buffer.mysql>show databases;+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.02 sec)MongoDB 基本安装配置Oracle 索引给我的思考相关资讯 MySQL安装
- MySQL安装、配置、使用及JDBC链接 (02/23/2015 12:42:19)
- Linux下MySQL默认安装目录和常用命 (10/29/2014 19:07:55)
- MySQL自动化运维之安装篇 (09/21/2014 10:00:17)
| - Linux编译安装MySQL (02/10/2015 19:49:03)
- CentOS 6.5 环境安装 MySQL 5.1 (09/22/2014 05:50:26)
- CentOS 6.4安装MySQL的过程中出现 (08/05/2014 06:40:47)
|
本文评论 查看全部评论 (0)