Jean Jean - 3 months ago 9x
MySQL Question

Mysql without root privilege

How do I start mysql without having root privileges/write access to tool area ?
I am getting following error

host13:~/JS> mysqld start
160706 18:06:31 [Warning] Can't create test file /tool/p64/.package/mysql-5.5.21/data/host13.lower-test
160706 18:06:31 [Warning] Can't create test file /tool/p64/.package/mysql-5.5.21/data/host13.lower-test
mysqld: Table 'mysql.plugin' doesn't exist
160706 18:06:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160706 18:06:31 InnoDB: The InnoDB memory heap is disabled
160706 18:06:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160706 18:06:31 InnoDB: Compressed tables use zlib 1.2.3
160706 18:06:31 InnoDB: Initializing buffer pool, size = 128.0M
160706 18:06:31 InnoDB: Completed initialization of buffer pool
160706 18:06:31 InnoDB: Operating system error number 30 in a file operation.
InnoDB: Error number 30 means 'Read-only file system'.
InnoDB: Some operating system error numbers are described at
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.


You can move MySQL data directory to where you are able to write, and then specify it in /etc/my.cnf (or possibly another location depending on your system defaults), the parameter is datadir.

If your data directory has not yet been initialized (in which case mysqld will complain about missing privilege tables) you can create them like this:

mysql_install_db --datadir=$path_to_new_datadir