安装mysql
sudo apt-get install mysql-server
安装过程会下载所必须的包,会打开图形安装界面要求你设置root密码
执行sql文件
首先进入mysql命令行
mysql -uroot -proot
注意-u和-p后面都没有空格
选择数据库
mysql> use test;
执行sql文件
mysql> source /home/hwj/test.sql
Mysql Administor和Mysql Workbench
Ubuntu12从仓库里删除了mysql-admin,原因是Mysql Administor在09年十二月的时候声明不再被支持和维护了,建议用户改用Mysql Workbench(MySQL Administrator was anounced EOL (End Of Life) on December 2009, and as such is no longer being developed or supported. All users are advised to switch to MySQL Workbench instead.)
安装Mysql Workbench的命令:
sudo apt-get install mysql-workbench