1.在ubuntu下面使用apt-get命令安装mysql-server
sudo apt-get install mysql-server
2.使用apt-get命令安装mysqlclient开发包,里面有一些mysql的source code,比如mysql.h文件,这些文件会被其他软件用到,比如opensips
sudo apt-get install libmysqlclient15-dev
3.安装apache2软件
4.安装phpmyadmin软件,通过这个软件可以通过WUI图形化的管理mysql数据库,非常方便
sudo apt-get install phpmyadmin
5.在apache2的安装路径下,创建一个指向phpmyadmin的符号连接
labuser@cnta02:/etc/apache2/conf.d$ sudo ln -s ../../phpmyadmin/apache.conf phpmyadmin.conf labuser@cnta02:/etc/apache2/conf.d$ ls -l total 4 -rw-r--r-- 1 root root 269 2009-08-18 22:13 charset lrwxrwxrwx 1 root root 28 2010-05-05 15:49 phpmyadmin.conf -> ../../phpmyadmin/apache.conf
6.重新启动apache服务
labuser@cntc06:/etc/init.d$ sudo ./apache2 stop * Stopping web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [ OK ] labuser@cntc06:/etc/init.d$ ps aux | grep apache labuser 7910 0.0 0.0 3004 772 pts/1 S+ 15:19 0:00 grep apache labuser@cntc06:/etc/init.d$ sudo ./apache2 start * Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [ OK ] labuser@cntc06:/etc/init.d$ ps aux | grep apache root 7930 0.0 0.2 20764 6400 ? Ss 15:19 0:00 /usr/sbin/apache2 -k start www-data 7934 0.0 0.1 20764 3440 ? S 15:19 0:00 /usr/sbin/apache2 -k start www-data 7935 0.0 0.1 20764 3440 ? S 15:19 0:00 /usr/sbin/apache2 -k start www-data 7936 0.0 0.1 20764 3440 ? S 15:19 0:00 /usr/sbin/apache2 -k start www-data 7937 0.0 0.1 20764 3440 ? S 15:19 0:00 /usr/sbin/apache2 -k start www-data 7938 0.0 0.1 20764 3440 ? S 15:19 0:00 /usr/sbin/apache2 -k start labuser 7940 0.0 0.0 3004 772 pts/1 S+ 15:19 0:00 grep apache
6.这时候应该就可以登录phpmyadmin了,输入http://yourIPaddress/phpmyadmin,应该就可以看到登录界面了
7.输入root:root登录即可
注:如果登录时不用输入密码就可以登录phpmyadmin的管理界面的话,这个时候root用户的权限会不足以设置mysql的一些设置选项,这个时候就需要重新设置mysql的root密码
# /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql -u root mysql mysql> use mysql; mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit # /etc/init.d/mysql restart # mysql -uroot -p Enter password: mysql>