我用的是乌班图,以乌班图为例:
1. 教你如何查看Ubuntu版本:
在终端中执行下列指令:
cat /etc/issue
可以查看当前正在运行的 Ubuntu 的版本号。其输出结果类似下面的内容:
Ubuntu 7.04 \n \l
参考文献:
http://www.linuxidc.com/Linux/2007-07/6178.htm
2. 我用的是这个版本的MySQL:
https://dev.mysql.com/downloads/repo/apt/
3. 安装步骤:
sudo dpkg -i /PATH/version-specific-package-name.deb
sudo apt-get update
sudo apt-get install mysql-server
参考文献:
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
4. 安装完毕后,需要配置:
在Mac或Linux上,需要编辑MySQL的配置文件,把数据库默认的编码全部改为UTF-8。MySQL的配置文件默认存放在/etc/my.cnf
或者/etc/mysql/my.cnf
:
[client]
default-character-set = utf8
[mysqld]
default-storage-engine = INNODB
character-set-server = utf8
collation-server = utf8_general_ci
参考文献:
http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014320107391860b39da6901ed41a296e574ed37104752000
5. 启动、关闭、重启MySQL:
Starting and Stopping the MySQL Server
The MySQL server is started automatically after installation. You can check the status of the MySQL server with the following command:
shell> sudo service mysql status
Stop the MySQL server with the following command:
shell> sudo service mysql stop
To restart the MySQL server, use the following command:
shell> sudo service mysql start
参考文献:
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
首先确定下service mysql命令,及所能使用的选项参数。
可以查看的到start是启动命令参数,stop为关闭命令参数。
首选确定数据库为关闭状态。 输入命令service mysql stop,关闭数据库。
http://jingyan.baidu.com/article/ca00d56c482eb0e99eebcfa5.html