1

Topic: MySQL initial problem

Hi!

I've used to creating data bases through webadmins, but now I need to create db user and so on in shell (webconfig is not available). And I don't know much...

Here's what I get: server running ClarkConnect Community Edition 4.0 (rpm-based router/firewall) the system has its own separate mysql install which it uses for webconfig (and I don't want to touch this) so I installed mysql with apt-get,

rpm -qa mysql
says:

mysql-4.1.20-2.cc

It seems that all mysql stuff is installed properly.

But when I try to set the root password for MySQL (or use mysqladmin) it says:

$ mysqladmin -u root password 'somepassword'

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

/etc/my.cnf points to /var/lib/mysql/  but this dir is empty.

$ps -A | grep mysql

 29997 ?        00:00:00 mysqld_safe
30065 ?        00:00:47 system-mysqld

Any ideas?

Re: MySQL initial problem

Make sure MySQL is running

3

Re: MySQL initial problem

>>> Make sure MySQL is running

How? I've just showed ps -A output, there is mysqld_safe and system-mysqld, do I need smth else?

Re: MySQL initial problem

Sorry, I missed that: try specifying the host as 127.0.0.1?
I think the .sock file got deleted, so hopefully the TCP/IP connection should work

5 (edited by Enemy 2007-04-11 21:29)

Re: MySQL initial problem

The first problem was solved (It's me to blame) ps showed system's mysql while I should run my own manually by #service mysqld start ... Anyway, that was stupid problem...

Smarty (or anyone), could you give me some hints on how to prepare it for punbb install (I need to create user, right?) and I think write mysqld start to rc.local to load it automatically (don't know exactly how).

Thanks in advance!

Re: MySQL initial problem

You'll need a database and a user with permissions over the database smile

7 (edited by Enemy 2007-04-11 22:34)

Re: MySQL initial problem

Smartys, smile

 mysql> grant all privileges on databasename.* to any_user@localhost identified by secretpassword;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'secretpassword' at line 1

Should I write any_user or substitute it with actual username (what?) what about secretpassword it is some kind of reserved word or?

Re: MySQL initial problem

grant all privileges on databasename.* to any_user@localhost identified by 'secretpassword';

where databasename is the name of the database, any_user is the username for your user, and secretpassword is the password you want for the user.

9

Re: MySQL initial problem

Also when I go to https://mydomain.net:81/mysql/ (webconfig web interface)
phpmyadmin asks for username and password, what should I enter here (root and MySQL password doesn't work)

Thanks!

Re: MySQL initial problem

The username/password that you created? If that doesn't work, I'm not sure

Re: MySQL initial problem

I discovered the following tinkering with a client's CC 4.0 box:

1. system-mysqld is used by ClarkConnect's reporting infrastructure -- eg. web proxy reports.
2. system-mysqld stores data in /var/lib/system-mysql, and the configuration file is /usr/share/system-mysql/etc/my.cnf
3. You need to use chkconfig to have the mysql daemon start up automatically each time you start.  However, in ClarkConnect you can use the web management interface to do this for you: https://domain.tld:81/
4. The my.cnf you checked was for the 'user-level' mysql daemon, which stores data in /var/lib/mysql.  You can install phpMyAdmin to the web root and access it (ensure web server is installed and running) using http://127.0.0.1/phpMyAdmin or so.  You should be able to use 'root' with no password in config.inc.php (remember to add a user and change password later).

smile