Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
where has mysql gone ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Wed Dec 17, 2003 10:51 pm    Post subject: where has mysql gone ? Reply with quote

where do i get /var/run/mysqld/mysqld.sock from
router mysql # mysql -u root -p
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
router mysql # /etc/init.d/mysql status
* status: started
router mysql # ps -A |grep mysql
router mysql # netstat -an | grep 3306
router mysql # lsof -i :mysql | grep LISTEN
router mysql # lsof /var/run/mysqld/mysqld.sock
lsof: status error on /var/run/mysqld/mysqld.sock: No such file or directory
router run # pwd
/var/run
router run # ls -l |grep my
drwxr-xr-x 2 mysql mysql 4096 Dec 17 23:57 mysqld
router mysqld # pwd
/var/run/mysqld
router mysqld # ls -l
total 0
router mysqld #
router files # find / -name *sock
/var/run/cgisock
/usr/portage/net-misc/sock
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Wed Dec 17, 2003 11:25 pm    Post subject: Reply with quote

sounds like it didn't start up. /etc/init.d/mysql zap && /etc/init.d/mysql start, and then ps aux|grep mysql. if its not running, then there's something in the config that's keeping it from launching.
_________________
Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Wed Dec 17, 2003 11:27 pm    Post subject: Reply with quote

router files # /etc/init.d/mysql zap && /etc/init.d/mysql start
* Manually resetting mysql to stopped state.
* Starting mysqld... [ ok ]
router files # ps aux|grep mysql
root 19549 0.0 0.2 1372 456 pts/0 S 00:30 0:00 grep mysql
router files # mysql -u root -p
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
router files #
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Thu Dec 18, 2003 12:41 am    Post subject: Reply with quote

Is there anything in the logs? Have a look at /var/log/mysql/mysql.err
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Thu Dec 18, 2003 12:52 am    Post subject: Reply with quote

that definitely means that mysql is not loading.
_________________
Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Thu Dec 18, 2003 7:34 am    Post subject: Reply with quote

router root # /etc/init.d/status
-bash: /etc/init.d/status: No such file or directory
router root # /etc/init.d/mysql status
* status: started
router root # mysql -u root -p
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
router root #


would sem to indicate it is - but where is going?
Or why cant i connetc to it?

AFAIK mysqld.sock is created dynamically
when and by what?
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Thu Dec 18, 2003 11:21 am    Post subject: Reply with quote

if it doesn't show up in ps aux, it's not running, despite what the rc script thinks.

1) zap the init script. 2) what's in your my.cnf?
_________________
Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide
Back to top
View user's profile Send private message
MagicMonkey
n00b
n00b


Joined: 17 Dec 2003
Posts: 37
Location: UK

PostPosted: Thu Dec 18, 2003 2:30 pm    Post subject: Reply with quote

It sounds like mysql is starting up, but then dying for some reason. Have you only just installed it? My guess is that you haven't created it's initial database (it needs a privs database to start up). There's a script for doing this called something like install-db.sh which needs to be run before mysql will start.

The messages in the error log should give you more of an idea of what's happening; it's probably at /var/log/mysql/mysql.err
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Thu Dec 18, 2003 8:28 pm    Post subject: Reply with quote

having restarted the server ( but ive done that before since having this problem) I can now access the mysql server.
I removed everything from /var/lib/mysql/ & ran mysql_install_db.
It has recreated all the tables in /var/lib/mysql/mysql/
however i cant access anything as root.
router mysql # mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 4.0.14

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql
ERROR 1044: Access denied for user: 'root@' to database 'mysql'
mysql>

when i try to creae a new database using webmin
i get
Failed to create database : DBI connect failed : Access denied for user: 'root@' to database 'mysql'

ie the root user doesnt have permission to access the mysql DB ( which the one that stores privileges (isnt it?)
So how do i get my root user to get access to the mysql DB & tables?

ive tried chowning everything to root and chmodding to 777 , which didnt solve it.

router mysql # cat my.cnf |grep -v '#'
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[safe_mysqld]
err-log = /var/log/mysql/mysql.err
[mysqld]
skip-innodb
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
log-error = /var/log/mysql/mysqld.err
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
bind-address = 127.0.0.1
port = 3306
[mysqldump]
quick
set-variable = max_allowed_packet=1M
[mysql]
[isamchk]
set-variable = key_buffer=16M
router mysql #
Back to top
View user's profile Send private message
MagicMonkey
n00b
n00b


Joined: 17 Dec 2003
Posts: 37
Location: UK

PostPosted: Fri Dec 19, 2003 3:37 pm    Post subject: Reply with quote

Try typing the following:

mysql -u root -h localhost mysql

and see what happens. Good luck...
Back to top
View user's profile Send private message
MagicMonkey
n00b
n00b


Joined: 17 Dec 2003
Posts: 37
Location: UK

PostPosted: Fri Dec 19, 2003 3:51 pm    Post subject: ps... Reply with quote

Quote:
ive tried chowning everything to root and chmodding to 777 , which didnt solve it.


By the way, the MySQL root user is not the same as the local root user (MySQL uses it's own authentication method); the database will be running as a user "mysql" which will need access to the actual database files.

If things have got screwed up, here's a bit of a "role-back-and-start-again" recovery procedure:

1) Stop the database daemon (/etc/init.d/mysql stop)
2) Delete everything from the data directory (rm -r /var/lib/mysql)
3) Re-run mysql_install_db
4) Start the database daemon again (/etc/init.d/mysql start)
5) Login as root with no password (mysql -u root)
6) See if it'll let you at the mysql database (use mysql)

Then you should be able to use Webmin; please make sure that the first thing you do is set the MySQL root password...

If anything fails, check the error log (/var/log/mysql/mysqld.err)
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Fri Dec 19, 2003 6:10 pm    Post subject: Reply with quote

many thanks :D :D .
Now to try phpwebsite/phpnuke/ etc etc
Back to top
View user's profile Send private message
eltech
Guru
Guru


Joined: 05 Nov 2002
Posts: 582
Location: New York

PostPosted: Thu Aug 26, 2004 1:18 pm    Post subject: Re: ps... Reply with quote

MagicMonkey wrote:
Quote:
ive tried chowning everything to root and chmodding to 777 , which didnt solve it.


By the way, the MySQL root user is not the same as the local root user (MySQL uses it's own authentication method); the database will be running as a user "mysql" which will need access to the actual database files.

If things have got screwed up, here's a bit of a "role-back-and-start-again" recovery procedure:

1) Stop the database daemon (/etc/init.d/mysql stop)
2) Delete everything from the data directory (rm -r /var/lib/mysql)
3) Re-run mysql_install_db
4) Start the database daemon again (/etc/init.d/mysql start)
5) Login as root with no password (mysql -u root)
6) See if it'll let you at the mysql database (use mysql)

Then you should be able to use Webmin; please make sure that the first thing you do is set the MySQL root password...

If anything fails, check the error log (/var/log/mysql/mysqld.err)
Dude .. you dont know what i was going through to get this all set up .. jeez ..

thanks much man ..

you need something stronger than n00b under your name, many people cant help halfway through what you just stepped me through .. outstanding
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum