ubuntu mysql源码安装
2012-10-11 16:18
281 查看
在ubuntu下安装mysql可以直接sudo apt-get install mysql
源码安装可以自由点,自定一些自己的设定
1,下载最新的mysql5.1.66
http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.66.tar.gz
2,config
./configure --prefix=/usr/local/mysql/ \--enable-assembler\
--with-charset=utf8\
--with-extra-charsets=complex\
--enable-thread-safe-client\
--with-big-tables\
--with-readline\
--with-ssl\
--with-embedded-server\
--enable-local-infile\
--with-plugins=partition,innobase,myisammrg
遇到没有error: No curses/termcap library found
sudo apt-get install libncurses5 libncurses5-dev3,sudo make
遇到 exec: g++: not found
sudo apt-get install gobjc++
继续make还是报错,重新config,sudo make 一切ok
4,sudo make install
5,新建mysql用户组和用户
sudo /usr/sbin/groupadd mysqlsudo /usr/sbin/useradd -g mysql mysql
6,初始化mysql db
sudo /usr/local/mysql/bin/mysql_install --user=mysql
//初始化结果代码
Installing MySQL system tables...121011 15:52:46 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OKFilling help tables...121011 15:52:48 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OK
To start mysqld at boot time you have to copysupport-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 X220 password 'new-password'
Alternatively you can run:/usr/local/mysql/bin/mysql_secure_installation
which will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.
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 mysql-test-run.plcd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!7,拷贝mysql.server和my.cnf
sudo cp mysql-5.1.66/support-files/my-medium.cnf /etc/my.cnf
sudo cp mysql-5.1.66/support-files/mysql.server /etc/init.d/mysql.server
8,修改mysql.server权限
sudo chmod 755 /etc/init.d/mysql.server
9,启动mysql
sudo /etc/init.d/mysql.server start
检测是否启动
ps aux|grep mysql
root 12872 0.0 0.0 2236 596 pts/2 S 16:12 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/X220.pidmysql 12974 0.1 0.3 113352 16020 pts/2 Sl 16:12 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/X220.err --pid-file=/usr/local/mysql/var/X220.pid --socket=/tmp/mysql.sock --port=3306charles 12995 0.0 0.0 4388 832 pts/2 S+ 16:14 0:00 grep --color=auto mysql
已经启动
编译安装完成
修改/usr/local/mysql/var(mysql数据库的datadir)的权限
sudo chown -R mysql:mysql /usr/local/mysql/var
剩下的事情就是根据需求修改mysql.cnf
以后再说
源码安装可以自由点,自定一些自己的设定
1,下载最新的mysql5.1.66
http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.66.tar.gz
2,config
./configure --prefix=/usr/local/mysql/ \--enable-assembler\
--with-charset=utf8\
--with-extra-charsets=complex\
--enable-thread-safe-client\
--with-big-tables\
--with-readline\
--with-ssl\
--with-embedded-server\
--enable-local-infile\
--with-plugins=partition,innobase,myisammrg
遇到没有error: No curses/termcap library found
sudo apt-get install libncurses5 libncurses5-dev3,sudo make
遇到 exec: g++: not found
sudo apt-get install gobjc++
继续make还是报错,重新config,sudo make 一切ok
4,sudo make install
5,新建mysql用户组和用户
sudo /usr/sbin/groupadd mysqlsudo /usr/sbin/useradd -g mysql mysql
6,初始化mysql db
sudo /usr/local/mysql/bin/mysql_install --user=mysql
//初始化结果代码
Installing MySQL system tables...121011 15:52:46 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OKFilling help tables...121011 15:52:48 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OK
To start mysqld at boot time you have to copysupport-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 X220 password 'new-password'
Alternatively you can run:/usr/local/mysql/bin/mysql_secure_installation
which will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.
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 mysql-test-run.plcd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!7,拷贝mysql.server和my.cnf
sudo cp mysql-5.1.66/support-files/my-medium.cnf /etc/my.cnf
sudo cp mysql-5.1.66/support-files/mysql.server /etc/init.d/mysql.server
8,修改mysql.server权限
sudo chmod 755 /etc/init.d/mysql.server
9,启动mysql
sudo /etc/init.d/mysql.server start
检测是否启动
ps aux|grep mysql
root 12872 0.0 0.0 2236 596 pts/2 S 16:12 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/X220.pidmysql 12974 0.1 0.3 113352 16020 pts/2 Sl 16:12 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/X220.err --pid-file=/usr/local/mysql/var/X220.pid --socket=/tmp/mysql.sock --port=3306charles 12995 0.0 0.0 4388 832 pts/2 S+ 16:14 0:00 grep --color=auto mysql
已经启动
编译安装完成
修改/usr/local/mysql/var(mysql数据库的datadir)的权限
sudo chown -R mysql:mysql /usr/local/mysql/var
剩下的事情就是根据需求修改mysql.cnf
以后再说
相关文章推荐
- ubuntu 源码MySQL 5.6安装后链接不上mysql.sock的问题
- 在Ubuntu上源码安装MySQL+安装问题解决+安全优化
- ubuntu13.10 源码安装apache2,php5,mysql 遇到的困难和解决方法
- ubuntu10.10,下载mysql源码,编译安装
- ubuntu 10.10 下 源码编译安装mysql 5.5.8
- ubuntu mysql-5.1.62源码安装
- ubuntu下源码安装mysql-5.1.34
- 【技术分享】【mysql】ubuntu14.04下 mysql5.6源码安装
- Ubuntu编译安装mysql源码
- ubuntu下MySQL安装指南(源码和一般安装两种)
- Ubuntu 16.04下 Mysql 5.7.17源码编译与安装
- Ubuntu 16.04下 Mysql5.7.17源码编译与安装
- Ubuntu14.04.*源码安装MySQL数据库mysql-5.6.*.tar.gz
- Ubuntu 14.04 源码安装mysql-5.6
- 在Ubuntu中使用源码编译安装Apache+MySQL+PHP+phpMyAdmin
- Ubuntu15.04下源码安装MySQL5.6.26数据库
- 在Ubuntu上源码安装MySQL+安装问题解决+安全优化
- 在virtualBox中安装Ubuntu虚拟机、实现文件共享、外网访问、主宿机组成内网访问、Mysql源码方式在ubuntu下的安装
- ubuntu/redhat/centOS下源码安装nginx+php+mysql
- 在ubuntu下使用源码包安装mysql