mysql server for ubuntu_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服务器是开机启动的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值