Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2110987
  • 博文数量: 195
  • 博客积分: 4378
  • 博客等级: 上校
  • 技术积分: 4046
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-09 11:37
个人简介

白天和黑夜只交替没交换无法想像对方的世界

文章分类

全部博文(195)

文章存档

2014年(3)

2013年(20)

2012年(18)

2011年(107)

2010年(17)

2009年(5)

2008年(20)

2007年(5)

分类: LINUX

2010-08-10 08:22:07

Ubuntu下安装mysql_server

(1)下载

下载mysql-5.0.56.tar.gz(即MySql Client Api,已经备份于qq邮箱)

tar zxvf mysql-5.0.56.tar.gz
cd mysql-5.0.56

(2)编译

./configure --prefix=/usr/local/mysql

在编译MYSQL时:

#./configure --prefix=/usr/local/mysql
执行后出现如下错误:
checking for tgetent in -ltermcap… no
checking for termcap functions library… configure: error: No curses/termcap library found
解决:安装.sudo apt-get install libncurses5-dev,即可,再次执行上述的编译命令。
(3)安装
sudo make
提示g++未找到。解决:用新立得下载g++.再次尝试。
后来报错:
redeclaration of C++ built-in type ‘bool‘。解决:执行make clean,再执行make distclean,清空编译缓存,重新编译(./configure).
sudo make install

(4)[root@fc8 mysql-5.0.51]# make;make install
[root@fc8 ~]# cp support-files/my-medium.cnf /etc/my.cnf
[root@fc8 ~]# cd /usr/local/mysql
[root@fc8 mysql]# bin/mysql_install_db --user=mysql
[root@fc8 mysql]# chown -R root  .
[root@fc8 mysql]# chown -R mysql var
[root@fc8 mysql]# chgrp -R mysql .
[root@fc8 mysql]# bin/mysqld_safe --user=mysql &
[root@fc8 mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)
mysql> exit
Bye

注意,以上安装的是mysql客户端。(客户端只是软件不是服务,添加path即可,无开机启动一说,开机启动只对服务而言。)
服务端请使用新立得安装mysql-server。安装过程会提示设置端口,设置帐号root的密码。
启动mysql服务器:sudo /etc/init.d/mysql start
关闭
mysql服务器:sudo /etc/init.d/mysql stop
查看mysql服务器是否启动:
sudo /etc/init.d/mysql status或者netstat -a | grep mysql
由于处理init.d目录下,mysql服务器是开机启动的。
阅读(5468) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~