MySQL at first time running

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
baran
Posts: 74
Joined: 8. Feb 2010, 17:41

MySQL at first time running

Post by baran »

Hi,

I installed mysql server on my Salix OS. I would like tu run it at 1st time. I did checked the checkbox in serveces after Startup. I did restart NTB ... :-( Error


root@darkstar:/etc/rc.d# mysqladmin -u root password root
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
root@darkstar:/etc/rc.d# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
root@darkstar:/etc/rc.d# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
root@darkstar:/etc/rc.d# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
root@darkstar:/etc/rc.d# clear
.........


Can you help me, please? I can run it on Debian, CentOS, but I am not able to run it on SalixOS :-( THNX.

Rene
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: MySQL at first time running

Post by thenktor »

Run the following to make the mysql start script executable:
chmod +x /etc/rc.d/rc.mysql

Initialize the database:
mysql_install_db

You also have to change ownership for the database:
chown -R mysql:mysql /var/lib/mysql

After that start mysql with:
/etc/rc.d/rc.mysql start
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
baran
Posts: 74
Joined: 8. Feb 2010, 17:41

Re: MySQL at first time running

Post by baran »

Great, it works. THNX.


Rene
prfaasse
Posts: 14
Joined: 22. Sep 2009, 18:31
Location: Amsterdam

Re: MySQL at first time running

Post by prfaasse »

Not to contradict Thenktor :D

You also might want to have a look at the contents of the file /etc/rc.d/rc.mysqld: there is a 'mini-mini-mini manual' inside as to how to actually make sure that mysqld (the mysql daemon) is to be properly initialized and/or configured. The remarks from Thenktor are 'there', as well as some info about what to do if you want to have your database-server accessible from the network (another machine using the mysql on your machine) and the like.
in case of panic: scream and run in circles
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: MySQL at first time running

Post by JRD »

thenktor wrote: Initialize the database:
mysql_install_db

You also have to change ownership for the database:
chown -R mysql:mysql /var/lib/mysql
Instead, su to the mysql user and run mysql_install_db. You should also run mysql_secure_installation after running the mysqld deamon:

Code: Select all

[root]# su mysql
[mysql] $ mysql_install_db
[mysql] $ exit
[root] # service start mysqld
[root] # mysql_secure_installation
Image
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: MySQL at first time running

Post by damNageHack »

<troll mode="on">Use PostgreSQL</troll>
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: MySQL at first time running

Post by thenktor »

JRD wrote:Instead, su to the mysql user and run mysql_install_db. You should also run mysql_secure_installation after running the mysqld deamon:

Code: Select all

[root]# su mysql
[mysql] $ mysql_install_db
[mysql] $ exit
[root] # service start mysqld
[root] # mysql_secure_installation
But this way you have to run the "chown" command before because AFAIR /var/lib/mysql belongs to root after package installation.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: MySQL at first time running

Post by JRD »

thenktor wrote:AFAIR /var/lib/mysql belongs to root after package installation.
No it's not.
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: MySQL at first time running

Post by thenktor »

OK :)
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
Post Reply