You are not logged in.

#1 2004-07-06 11:56:49

potentials
Member
Registered: 2004-01-04
Posts: 130

Can't start mysql

Followed the wiki to configure apache/php/mysql, it went fine until I reached the part of configuring mysql

[root@Faroukians /]# /etc/rc.d/mysqld start
:: Starting MySQL                                                                               [DONE]

When I try to start mysql, I get the following:

[root@Faroukians /]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Offline

#2 2004-07-06 12:43:27

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Can't start mysql

be sure the following line is in your /etc/hosts file.

127.0.0.1 localhost

hth,
-wd


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#3 2004-07-06 12:53:08

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

Its already there, its not an apache problem, its a problem with mysql.

Offline

#5 2004-07-06 15:39:10

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Can't start mysql

potentials wrote:

Its already there, its not an apache problem, its a problem with mysql.

as a FYI, mysqld is a server, it needs to know the host properly too.

Offline

#6 2004-07-06 17:02:35

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

Shouldn't it work specially that I followed the wiki?

Offline

#7 2004-07-06 18:17:22

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Can't start mysql

Yes, it should, and if it doesn't, the wiki needs to be edited. wink I recall having a similar problem to yours, but I don't remember how I fixed it. It looks like the server is running, but is refusing connections. This means its refusing connections from the local machine because it feels it is unprivleged to do so.   You'll need to use mysqladmin to set up the privledges or at least find out what host mysql *thinks* your local machine is.  I think mysql might use localhost.localdomain by default... my /etc/hosts looks like this:

127.0.0.1        localhost.localdomain    localhost

Dusty

Offline

#8 2004-07-07 10:15:38

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

/etc/hosts looks just like you said but I still get the error, not to mention that I can't see any mysql related process when trying ps -e after running the /etc/rc.d/mysqld script.

Offline

#9 2004-07-07 15:30:30

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Can't start mysql

hmmm. Sounds as if the daemon isn't starting, rather than refusing connections.

Get some error messages... try starting mysqld dircetly maybe, or edit the /etc/rc.d/mysqld script to not redirect output to /dev/null...  Or does syslog log script output, I don't remember...

Dusty

Offline

#10 2004-07-07 15:42:24

jojapa
Member
Registered: 2004-02-09
Posts: 13

Re: Can't start mysql

just look at /var/lib/mysql for a file called <your hostname>.err,
it's a text file with the startup sequence of mysql.

Offline

#11 2004-07-07 17:00:18

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

just look at /var/lib/mysql for a file called <your hostname>.err,
it's a text file with the startup sequence of mysql.

thanks alot, here's my /var/lib/mysql/localhost.err

040707 15:47:12  mysqld started
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
040707 15:47:12  Can't init databases
040707 15:47:12  Aborting

040707 15:47:12  InnoDB: Warning: shutting down a not properly started
                 InnoDB: or created database!
040707 15:47:12  /usr/sbin/mysqld: Shutdown Complete

040707 15:47:12  mysqld ended

Offline

#12 2004-07-07 17:04:43

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Can't start mysql

maybe no database created. Did you call:?

# mysql_install_db --user=mysql
# chown -R mysql.mysql /var/lib/mysql

as root? It's in the wiki, but maybe you missed that step?

Dusty

Offline

#13 2004-07-07 20:28:18

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Can't start mysql

Dusty wrote:

maybe no database created. Did you call:?

# mysql_install_db --user=mysql
# chown -R mysql.mysql /var/lib/mysql

as root? It's in the wiki, but maybe you missed that step?

Dusty

If you start up mysql using /etc/rc.d/mysqld, this is done for you the first time you call it as well as  set up mysql user, etc....


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#14 2004-07-08 13:39:57

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

done, same problem

Offline

#15 2004-07-08 15:14:05

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Can't start mysql

why not remove mysql entirely (make sure you remove the files it leaves behind) then reinstall it? as i remember upon install or first run it prints clear instructions. my mysql functions just fine and i did not use the wiki.


AKA uknowme

I am not your friend

Offline

#16 2004-07-09 10:57:47

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: Can't start mysql

uninstalled, removed remaing files and re-installed, nothing happens on install or first running.

Offline

#17 2004-07-09 15:37:34

lytez
Member
Registered: 2003-11-28
Posts: 16
Website

Re: Can't start mysql

Ok, I saw this post and decided to give mysql a try.  Upon first running /etc/rc.d/mysqld I get this message:

WARNING: The host 'zanzibar' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !

But even with this message, the server starts up fine...not sure if this post helps anything...[/code]

EDIT: If you get this warning message it is beecause you need to add an entry in /etc/hosts. I just added zanzibar to the end of the entry for 127.0.0.1 and its fine.


.: lytez :.

Offline

#18 2004-07-09 16:59:04

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Can't start mysql

potentials wrote:

uninstalled, removed remaing files and re-installed, nothing happens on install or first running.

To completey remove mysql, you need to do more then a pacman -R mysql, here are my suggested steps to follow if you haven't done them.

[root@frisco root]# pacman -R mysql
removing mysql...
warning: /etc/my.cnf saved as /etc/my.cnf.pacsave
warning: /etc/conf.d/mysqld saved as /etc/conf.d/mysqld.pacsave
done.
[root@frisco root]# userdel -r mysql

Then

[root@frisco root]# pacman -S mysql

Targets: mysql-4.0.20-2

Proceed with upgrade? [Y/n] y

checking package integrity... done.
loading package data... done.
checking for file conflicts... done.
installing mysql... done.
[root@frisco root]# /etc/rc.d/mysqld start
:: Adding mysql group                                                    [DONE]
:: Adding mysql user                                                     [DONE]
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
040709 12:57:16  /usr/sbin/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h frisco password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

:: Starting MySQL                                                        [DONE]
[root@frisco root]#

If your messages don't look like mine, then something else is wrong.

-wd


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#19 2007-05-21 15:48:52

usedtire
Member
Registered: 2004-02-12
Posts: 50

Re: Can't start mysql

Had to run mysql with this command to verify the installation

mysqld --skip-grant-tables --user=mysql

Found that the command
mysql_install_db --datadir=/var/lib/mysql --user=mysql
was failing

ran it without "--user=mysql" as root and then
chown -R mysql:mysql /var/lib/mysql

that seemed to fix the problem

now the /etc/rc.d/mysqld works fine

Offline

Board footer

Powered by FluxBB