how to install mysql-server into a pendrive
hello everybody
i need to install mysql-server into a pendrive because i want to use a database into the pendrive.. i'm using debian, and i tried to put the var/lib/mysql directory into the pendrive, then i modified the my.cnf file with this string: datadir = /media/pen/database/mysql (the path into the pendrive is database/mysql) instead of: datadir = /var/lib/mysql but now when i write "mysql -u root -p" i receice this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) i think because i have to install mysql into the pendrive, isn't it? please helm me!! thanks nichis |
mysqld.sock
My guess is that '/var/run/mysqld/mysqld.sock' does not exist or does not have the right permissions for mysql to write to it.
Create '/var/run/mysqld/mysqld.sock' and chown to user mysql. If you can then start mysql service you can try linking this file to your pendrive. # cd /var/lib/mysql/ # ln -s /var/run/mysqld/mysqld.sock mysql.sock |
Quote:
Thanks for the answer, i have created '/var/run/mysqld/mysqld.sock' and put the permission (777), then i have created the link, but i haven't understand how to link it into the pendrive.. i receive always the same error |
did you try and start mysql before creating the symlink?
|
Quote:
|
Did you install mysql on the local machine then tried to move things to the pendrive?
Did you install mysql using tar file or rpm? If you tried the install via the rpm package I would suggest you download the tar file for the version of mysql that you want to install and untar the tar file onto your pendrive. This is for Windows but you could sort of follow for a Linux install. |
Quote:
|
Quote:
datadir = /media/pen/database/mysql So you would shutdown mysql. Go to /var/run/mysqld/. Create a symlink that points to /media/pen/database/mysql like this (cd /var/run/mysqld; ln -s /media/pen/database/mysql/mysql.sock mysql.sock) Then try starting again. It should link over to where mysql is actually writing that file now. |
Quote:
then into the my.cnf file i put " datadir = /media/pen/database/mysql " but now i have the problem that i can't create other databases :( , i receive this error: ERROR 1006 (HY000): Can't create database 'asd' (errno: 13) |
Quote:
the strange thing is that when i do "chmod -R 777 /media/pen/database/mysql" nothing happen!!.. it remain 755 :S ... why?? root@debian:/media/pen/database# ls -l total 4 drwxr-xr-x 5 root root 4096 Nov 18 17:48 mysql |
Quote:
Make this folder owned by mysql by doing this: chown -R mysql:mysql /media/pen/database/mysql Then see if anything changes. |
Quote:
|
All times are GMT -5. The time now is 02:56 AM. |