Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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 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.
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.
yes, i installed it using apt-get.. and it works, i had the problems when i tried to put the database into the pendrive
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
I believe that he will require making a symlink to the pendrive, where the configuation is pointing.
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.
I believe that he will require making a symlink to the pendrive, where the configuation is pointing.
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.
i think i have resolved this cutting the content of /var/lib/mysql and putting all it into /pen/database/mysql
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:
i note that mysql process hasn't permission to create a new folder on the pendrive
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.