How to setup mysql on porteus?
-
- White ninja
- Posts: 21
- Joined: 08 Jan 2013, 05:07
- Distribution: Porteus v3.1 KDE 64-bit
- Location: USA
How to setup mysql on porteus?
After downloading mysql (with dependencies) and activating the module, I get this error message after typing in "mysql -u root -p":
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
I'm not too familiar with how to set up mysql on porteus, but any help is appreciated.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
I'm not too familiar with how to set up mysql on porteus, but any help is appreciated.
Re: How to setup mysql on porteus?
Easy to solve !
Executes these commands in a changes-saved environment (as root):
Executes these commands in a changes-saved environment (as root):
- Making executable the mysql run script
Code: Select all
chmod +x /etc/rc.d/rc.mysqld
- Executing the mysql run script in order to run mysql
Code: Select all
/etc/rc.d/rc.mysqld start
NjVFQzY2Rg==
-
- White ninja
- Posts: 21
- Joined: 08 Jan 2013, 05:07
- Distribution: Porteus v3.1 KDE 64-bit
- Location: USA
Re: How to setup mysql on porteus?
I executed the commands:
and got the following output:
So I'm guessing its good up to that point.
However, when I login as root (no password by default) I'm still getting the same error:
Code: Select all
>chmod +x /etc/rc.d/rc.mysqld
>/etc/rc.d/rc.mysqld start
Code: Select all
130108 12:25:50 mysqld_safe Logging to '/var/lib/mysql/porteus.err'.
130108 12:25:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130108 12:25:51 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
However, when I login as root (no password by default) I'm still getting the same error:
Code: Select all
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Re: How to setup mysql on porteus?
Does this command helps you?
Code: Select all
touch /var/run/mysql/mysql.sock
NjVFQzY2Rg==
-
- White ninja
- Posts: 21
- Joined: 08 Jan 2013, 05:07
- Distribution: Porteus v3.1 KDE 64-bit
- Location: USA
Re: How to setup mysql on porteus?
I noticed the error message is a little different this time:
At the end of the output, the (2) is now a (111).
Code: Select all
>touch /var/run/mysql/mysql.sock
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
Re: How to setup mysql on porteus?
Restart the mysql server according to my previous post.
NjVFQzY2Rg==
-
- White ninja
- Posts: 21
- Joined: 08 Jan 2013, 05:07
- Distribution: Porteus v3.1 KDE 64-bit
- Location: USA
Re: How to setup mysql on porteus?
Same outcome:
Code: Select all
>chmod +x /etc/rc.d/rc.mysqld
>/etc/rc.d/rc.mysqld start
130108 13:04:04 mysqld_safe Logging to '/var/lib/mysql/porteus.err'.
130108 13:04:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130108 13:04:07 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
>touch /var/run/mysql/mysql.sock
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
- wread
- Module Guard
- Posts: 1256
- Joined: 09 Jan 2011, 18:48
- Distribution: Porteus v5.0-kde-64 bits
- Location: Santo Domingo
- Contact:
Re: How to setup mysql on porteus?
I had this problem once and solved it. It is in this post:
http://forum.porteus.org/viewtopic.php? ... ysql#p6136
Try it, it worked for me!
Regards!
http://forum.porteus.org/viewtopic.php? ... ysql#p6136
Try it, it worked for me!
Regards!
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!
The Porteus Community never sleeps!
Re: How to setup mysql on porteus?
The problem is simple to solve. I had forgot this little detail as i'm usually running mysql on another distribution than Porteus.
Do these steps:
Do these steps:
- Open /etc/rc.d/rc.mysqld
- Search the line with "/usr/bin/mysqld_safe"
- Add just before "--datadir" (but can done at end of line too) argument this:
Code: Select all
--user=root
- You should have a begin of line like this
Code: Select all
/usr/bin/mysqld_safe --user=root --datadir=/var/lib/mysql
NjVFQzY2Rg==
-
- White ninja
- Posts: 21
- Joined: 08 Jan 2013, 05:07
- Distribution: Porteus v3.1 KDE 64-bit
- Location: USA
Re: How to setup mysql on porteus?
I've applied all suggestions thus far, but with no success. I'll explain exactly what I've done.
This file:
has been editted with this line of code:
changed to:
Using this module:
which was converted from slackware, I get the following output upon following these instructions:
Using this module:
which was downloaded from the link supplied by wread, I get the following output from these instructions:
And finally, using this module:
which was downloaded from the official porteus repository, I get this output:
Note that in each case the mysql modules were not allowed to run at the same time.
So it doesn't seem that changing the module nor the instructions thus far fixes the issue, as I still get:
as the final outcome.
This file:
Code: Select all
/etc/rc.d/rc.mysqld
Code: Select all
/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
Code: Select all
/usr/bin/mysqld_safe --user=root --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
Using this module:
Code: Select all
mysql-5.0.67-i486-1.xzm
Code: Select all
>chmod +x /etc/rc.d/rc.mysqld
>/etc/rc.d/rc.mysqld start
nohup: redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
130108 15:33:28 mysqld ended
>touch /var/run/mysql/mysql.sock
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
Code: Select all
mysql-5.1.46.xzm
Code: Select all
>chmod +x /etc/rc.d/rc.mysqld
>/etc/rc.d/rc.mysqld start
130108 15:42:23 mysqld_safe Logging to '/var/lib/mysql/porteus.err'.
130108 15:42:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130108 15:42:24 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
>touch /var/run/mysql/mysql.sock
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
Code: Select all
mysql-5.1.56-i486-1.xzm
Code: Select all
>chmod +x /etc/rc.d/rc.mysqld
>/etc/rc.d/rc.mysqld start
130108 15:47:17 mysqld_safe Logging to '/var/lib/mysql/porteus.err'.
130108 15:47:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130108 15:47:17 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
>touch /var/run/mysql/mysql.sock
>mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
So it doesn't seem that changing the module nor the instructions thus far fixes the issue, as I still get:
Code: Select all
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
Re: How to setup mysql on porteus?
This working fine here. Tested 3 times with fresh vanilla ISO of Porteus and mysql from slackyd.
You must have missed something or mixed some instructions.
You must have missed something or mixed some instructions.
NjVFQzY2Rg==
- wread
- Module Guard
- Posts: 1256
- Joined: 09 Jan 2011, 18:48
- Distribution: Porteus v5.0-kde-64 bits
- Location: Santo Domingo
- Contact:
Re: How to setup mysql on porteus?
Are you using a 64-bit machine? if yes, you will need the 64-bit version of mysql..
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!
The Porteus Community never sleeps!
-
- Shogun
- Posts: 333
- Joined: 26 Jan 2011, 16:15
- Distribution: Porteus 3.2 and 4.0 64bit KDE
- Location: Malaysia
Re: How to setup mysql on porteus?
Hi WavyLinesAreNotReal,
Try these steps:-
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:mysql /var/run/mysql
and then start
/etc/rc.d/rc.mysqld start
Try these steps:-
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:mysql /var/run/mysql
and then start
/etc/rc.d/rc.mysqld start
Re: How to setup mysql on porteus?
Interesting, it may also works with these fixes as it doesn't need to executes from root. The problem is that the mysqld is executed from root and by design mysql doesn't allow to be ran by root for security reasons expect if you force it by using "--user=root".
NjVFQzY2Rg==