MySQL源码安装

MySQL源码安装

Linux环境为CentOS release 4.7
Kernel 2.6.9-78.EL on an i686
login:
MySQL安装包mysql-4.1.18.tar.gz
[switch@localhost ~]$ su -
Password:
[root@localhost ~]# cd /data
[root@localhost data]# ll
总用量 16796
-rw-r--r--  1 root root 17172994 12月 12 13:32 mysql-4.1.18.tar.gz
创建mysql用户组和用户
[root@localhost data]# groupadd mysql                
[root@localhost data]# useradd -g mysql mysql    
提取mysql源码文件
[root@localhost data]# tar -xzvf mysql-4.1.18.tar.gz
[root@localhost data]# ls
mysql-4.1.18   mysql-4.1.18.tar.gz
[root@localhost data]# cd mysql-4.1.18
创建和指定mysql安装目录
[root@localhost mysql-4.1.18]# mkdir /usr/local/mysql
[root@localhost mysql-4.1.18]# ./configure --prefix=/usr/local/mysql
使用make编译程序
[root@localhost mysql-4.1.18]# make
[root@localhost mysql-4.1.18]# make install
复制mysql配置文件
[root@localhost mysql-4.1.18]# cp support-files/my-medium.cnf /etc/my.cnf
[root@localhost mysql-4.1.18]# cd /usr/local/mysql/
创建mysq初始授权表
[root@localhost mysql]# bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
 
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password new-password
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password new-password
See the manual for more instructions.
 
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
 
You can test the MySQL daemon with the benchmarks in the sql-bench directory:
cd sql-bench ; perl run-all-tests
 
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
 
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
改变当前目录属性为root用户,-R为递归连子目录一起更改。
[root@localhost mysql]# chown -R root .
更改var目录属性
[root@localhost mysql]# chown -R mysql var
更改当前目录组为mysql用户
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# ll
总用量 40
drwxr-xr-x  2 root  mysql 4096 12月 12 13:54 bin
drwxr-xr-x  3 root  mysql 4096 12月 12 13:54 include
drwxr-xr-x  2 root  mysql 4096 12月 12 13:54 info
drwxr-xr-x  3 root  mysql 4096 12月 12 13:54 lib
drwxr-xr-x  2 root  mysql 4096 12月 12 13:54 libexec
drwxr-xr-x  3 root  mysql 4096 12月 12 13:54 man
drwxr-xr-x  7 root  mysql 4096 12月 12 13:54 mysql-test
drwxr-xr-x  3 root  mysql 4096 12月 12 13:54 share
drwxr-xr-x  5 root  mysql 4096 12月 12 13:54 sql-bench
drwx------  4 mysql mysql 4096 12月 12 13:57 var
后台启动mysql守护程序启动mysql数据库。
[root@localhost bin]# /usr/local/mysql/bin/mysqld_safe --user=mysql &
[1] 31178
[root@localhost bin]# Starting mysqld daemon with databases from /usr/local/mysql/var
[root@localhost bin]# ps -A|grep mysql
31178 pts/1    00:00:00 mysqld_safe
31202 pts/1    00:00:00 mysqld
启动mysql
[root@localhost bin]# /usr/local/mysql/bin/mysql
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值