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
MySQL at first time running
Re: MySQL at first time running
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
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
Re: MySQL at first time running
Great, it works. THNX.
Rene
Rene
Re: MySQL at first time running
Not to contradict Thenktor
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.
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
Re: MySQL at first time running
Instead, su to the mysql user and run mysql_install_db. You should also run mysql_secure_installation after running the mysqld deamon:thenktor wrote: Initialize the database:
mysql_install_db
You also have to change ownership for the database:
chown -R mysql:mysql /var/lib/mysql
Code: Select all
[root]# su mysql
[mysql] $ mysql_install_db
[mysql] $ exit
[root] # service start mysqld
[root] # mysql_secure_installation
- damNageHack
- Posts: 663
- Joined: 24. Sep 2009, 17:07
Re: MySQL at first time running
<troll mode="on">Use PostgreSQL</troll>
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.
Re: MySQL at first time running
But this way you have to run the "chown" command before because AFAIR /var/lib/mysql belongs to root after package installation.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
Re: MySQL at first time running
No it's not.thenktor wrote:AFAIR /var/lib/mysql belongs to root after package installation.