1、安装mysql:sudo apt-get install mysql-server-5.5
2、更改mysql的数据目录:修改/etc/mysql/my.cnf:
将datadir=/var/lib/mysql修改为
datadir=/data/myql
3、重启mysql:sudo /etc/init.d/mysql restart
报错:Job failed to start
sudo tail error.log
130628 13:58:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130628 13:58:47 InnoDB: Compressed tables use zlib 1.2.3.4
130628 13:58:47 InnoDB: Initializing buffer pool, size = 128.0M
130628 13:58:47 InnoDB: Completed initialization of buffer pool
130628 13:58:47 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
4、修改ubuntu的selinux,即