Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> MySQL Problem! Can't Connect To Server, help!
nightfox
post Nov 7 2005, 01:20 AM
Post #1


NiGHTFoX - Hiding in the dark
Group Icon

Group: Members
Posts: 680
Joined: 3-April 05
Member No.: 3,584



Hi, not sure if this is the correct spot but it is on MySQL which is database software! wink.gif

Ok, I am configuring a server for practice and I have run into problems with MySQL... I can't start it!!

I'm running SUSE Linux Enterprise Server 9, and in the shell - konsole window, I typed:
mysqld start
and that brings up the following:
mysqld: Too many parameters
mysqld Ver 3.23.49 for pc-linux-gnu on i686
Use '--help' or '--no-defaults --help' for a list of available options

So then I tried:
mysql -o

and then I got:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I looked and 'mysql.sock' isn't even there! Other than that, everything works fine, Apache, PHP... it all works... I can view PHP pages fine over my network on my windows machine perfectly... I'm just having problems with MySQL since this is the first time I have ever tried this on a Linux system.

Thanks for any help!

[N]F

This post has been edited by microscopic^earthling: Nov 7 2005, 02:47 AM
Go to the top of the page
 
+Quote Post
Houdini
post Nov 7 2005, 01:50 AM
Post #2


Super Member
Group Icon

Group: Members
Posts: 572
Joined: 25-April 05
From: Nashville Tennessee
Member No.: 4,340



You may already have MySQL installed before you installed another copy:
To find out if you have MySQL type ps -ax in the list of programs that appears look for one called mysqld
If MySQL is installed but not running then try typing this:
find / -name "mysql*" if a directory named mysql is found you have it installed! So you want to start it up
Change to the dirsctory mysql/bin
type safe_mysql &. then you should see a prompt.
The MySQL comes out of the box with root and no password so you can use that until you set up your own passord and username
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Nov 7 2005, 02:31 AM
Post #3


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411
myCENTs:84.36



QUOTE(nightfox @ Nov 7 2005, 08:20 AM)
Hi, not sure if this is the correct spot but it is on MySQL which is database software! wink.gif

Ok, I am configuring a server for practice and I have run into problems with MySQL... I can't start it!!

I'm running SUSE Linux Enterprise Server 9, and in the shell - konsole window, I typed:
mysqld start
and that brings up the following:
mysqld: Too many parameters
mysqld Ver 3.23.49 for pc-linux-gnu on i686
Use '--help' or '--no-defaults --help' for a list of available options

So then I tried:
mysql -o

and then I got:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I looked and 'mysql.sock' isn't even there! Other than that, everything works fine, Apache, PHP... it all works... I can view PHP pages fine over my network on my windows machine perfectly... I'm just having problems with MySQL since this is the first time I have ever tried this on a Linux system.

Thanks for any help!

[N]F
*



See if your mysql.sock doesn't exist - it means mysql server isn't running at all. Whenever the server runs, a .sock file will be created for sure. Even then, as houdini said, try doing a ps and make sure that it isn't running:
CONSOLE
shell> ps ax | grep mysql
8875 ? S 0:00 mysqld -u root
6384 pts/10 S 0:00 grep mysql


That will list any process with the name mysql as you can see above - if you don't see something like the first output line - it means your server isn't running.

To start your server you need to do the following:
CONSOLE
shell> mysqld -u root &

That should get the server started in background. Keep in mind, the space between, -u and root and don't miss out on the & sign.

Next step would be to connect to your server using the command line client:
CONSOLE

shell> mysql -u root -p
Enter Password:

At the enter password prompt, enter your root password - which you setup during installation. In case of linux, there's no initial root pass, so pressing enter would get you to the command line client.

You were basically using wrong parameters to start server/connect - hence your problems arose.

P.S. PHP & Apache will still run even if mysql isn't running.

Regards,
m^e
Go to the top of the page
 
+Quote Post
nightfox
post Nov 8 2005, 04:27 AM
Post #4


NiGHTFoX - Hiding in the dark
Group Icon

Group: Members
Posts: 680
Joined: 3-April 05
Member No.: 3,584



QUOTE(microscopic^earthling @ Nov 6 2005, 10:31 PM)
To start your server you need to do the following:
CONSOLE
shell> mysqld -u root &


*


Thanks m^e... I'm going to print this topic for future refrence but I ran into a problem when I ran the above. I'm going to quote what I typed, FYI, "linux" is the host name and I have no idea how to set that or anything but that is another topic! wink.gif and the bold stuff is what I typed into the shell console
QUOTE
linux:~ # mysqld -u root &
[1] 22177
linux:~ # 051108  4:13:36  mysqld: Table 'mysql.host' doesn't exist


When I did a search for "mysql", I got a lot of results so I know MySQL is installed... I even have gone in through YaST and MySQL server and client are checked and installed. The shell command: find / -name "mysql*", brought up lots of directories... there's one in usr/bin, var/lock/subsys, var/lib, usr/lib, usr/sbin/mysqld (is this it? or something important?), usr/share, and some other sim. ones were in data1/usr/* (star just means the MySQL directories, not as many.)

All I know is that I got a new error and that is a good thing! At least I know I am making progress! smile.gif

If only I wasn't such a Linux noob!

[N]F
Go to the top of the page
 
+Quote Post
yordan
post Nov 8 2005, 09:32 PM
Post #5


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 2,242
Joined: 16-August 05
Member No.: 7,896
myCENTs:56.55



QUOTE
mysqld: Table 'mysql.host' doesn't exist

I would say that this means that mysql has not been correctly installed.
I suggest uninstall it properly, and then re-install it again.
Regards
Yordan
Go to the top of the page
 
+Quote Post
CarolinaBlues
post Nov 8 2005, 09:48 PM
Post #6


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 14
Joined: 8-November 05
Member No.: 9,508



Mine connects
Go to the top of the page
 
+Quote Post
nightfox
post Nov 9 2005, 12:06 AM
Post #7


NiGHTFoX - Hiding in the dark
Group Icon

Group: Members
Posts: 680
Joined: 3-April 05
Member No.: 3,584



Yay! I actually got somewhere... No Errors!! biggrin.gif

Ok, but I kind of need some help!

I typed in:
"mysqld -u root &"
I got:
"mysqld: ready for connections"
BUT, if you look at the display...
QUOTE
linux:~ # mysqld -u root &
[1] 4217
linux:~ # mysqld: ready for connections
[]

the two brackets [] at the end there is where the cursor was.... as soon as I tried mysql -u root -p just like m^e said but it can't find the command "mysql"... well, at least I made SOME progress....

can anyone help me setup tables and stuff from the counsole or at least until I can get PHPMyAdmin installed?

Thanks!

[N]F
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Nov 9 2005, 06:17 AM
Post #8


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411
myCENTs:84.36



One question - is this a new installation or did you install it over an earlier version ? If so you'll need to run some table/privilege fixing routines.

The error message table mysql.hosts doesn't exist clearly means that your installation was broken. All the tables under the database called mysql are created automatically with a basic set of rights - they are needed for normal functioning of mysql.

As for your installation directory - if you didn't specify any during installation, it would by default install into /usr/bin/ - that's where all the mysql executables reside.

Here's a list of the files that should be there:
QUOTE
-rwxr-xr-x  1 root root 2071116 Oct 22 02:46 myisamchk
-rwxr-xr-x  1 root root 1966000 Oct 22 02:46 myisam_ftdump
-rwxr-xr-x  1 root root 1974308 Oct 22 02:46 myisamlog
-rwxr-xr-x  1 root root 2001844 Oct 22 02:46 myisampack
-rwxr-xr-x  1 root root  751328 Oct 22 02:46 my_print_defaults
-rwxr-xr-x  1 root root 1943896 Oct 22 02:47 mysql
-rwxr-xr-x  1 root root  110667 Oct 22 02:47 mysqlaccess
-rwxr-xr-x  1 root root 1746000 Oct 22 02:47 mysqladmin
-rwxr-xr-x  1 root root    125 Dec 18  2004 mysql-administrator
-rwxr-xr-x  1 root root 6628756 Dec 18  2004 mysql-administrator-bin
-rwxr-xr-x  1 root root 1800200 Oct 22 02:47 mysqlbinlog
-rwxr-xr-x  1 root root  10347 Oct 22 02:47 mysqlbug
-rwxr-xr-x  1 root root 1741700 Oct 22 02:47 mysqlcheck
-rwxr-xr-x  1 root root 2015420 Oct 22 02:47 mysql_client_test
-rwxr-xr-x  1 root root    4551 Apr  3  2005 mysql_config
-rwxr-xr-x  1 root root    2977 Oct 22 02:47 mysql_convert_table_format
-rwxr-xr-x  1 root root  36201 Oct 22 02:47 mysql_create_system_tables
-rwxr-xr-x  1 root root  23188 Oct 22 02:47 mysqld_multi
-rwxr-xr-x  1 root root  12816 Oct 22 02:47 mysqld_safe
-rwxr-xr-x  1 root root 1777464 Oct 22 02:47 mysqldump
-rwxr-xr-x  1 root root    6160 Oct 22 02:47 mysqldumpslow
-rwxr-xr-x  1 root root  10419 Oct 22 02:47 mysql_explain_log
-rwxr-xr-x  1 root root    2653 Oct 22 02:47 mysql_find_rows
-rwxr-xr-x  1 root root    483 Oct 22 02:47 mysql_fix_extensions
-rwxr-xr-x  1 root root    5118 Oct 22 02:47 mysql_fix_privilege_tables
-rwxr-xr-x  1 root root  32790 Oct 22 02:47 mysqlhotcopy
-rwxr-xr-x  1 root root 1739024 Oct 22 02:47 mysqlimport
-rwxr-xr-x  1 root root    8693 Oct 22 02:47 mysql_install_db
-rwxr-xr-x  1 root root    129 Dec 19  2004 mysql-query-browser
-rwxr-xr-x  1 root root 7795516 Dec 19  2004 mysql-query-browser-bin
-rwxr-xr-x  1 root root    6308 Oct 22 02:47 mysql_secure_installation
-rwxr-xr-x  1 root root  17275 Oct 22 02:47 mysql_setpermission
-rwxr-xr-x  1 root root 1740196 Oct 22 02:47 mysqlshow
-rwxr-xr-x  1 root root  14476 Oct 22 02:47 mysql_tableinfo
-rwxr-xr-x  1 root root 1823904 Oct 22 02:47 mysqltest
-rwxr-xr-x  1 root root 1907128 Oct 22 02:47 mysqltestmanager
-rwxr-xr-x  1 root root 1732840 Oct 22 02:47 mysqltestmanagerc
-rwxr-xr-x  1 root root  580784 Oct 22 02:47 mysqltestmanager-pwgen
-rwxr-xr-x  1 root root  736600 Oct 22 02:47 mysql_tzinfo_to_sql
-rwxr-xr-x  1 root root  724496 Oct 22 02:46 mysql_waitpid
-rwxr-xr-x  1 root root    3118 Oct 22 02:47 mysql_zap


One thing that you can try without re-installing it is to run the command:
CONSOLE

shell> /usr/bin/mysql_install_db
And then
shell> /usr/bin/mysql_fix_privilege_tables


See if this helps. Otherwise it seems your installation got badly messed up and only solution is to uninstall all and reinstall using the RPM packages from their site.

Let me know how far you progressed.

Regards,
m^e
Go to the top of the page
 
+Quote Post
nightfox
post Nov 12 2005, 04:46 AM
Post #9


NiGHTFoX - Hiding in the dark
Group Icon

Group: Members
Posts: 680
Joined: 3-April 05
Member No.: 3,584



Thanks for the tips m^e and everyone else.

Since I work at my high school's IT department and we're setting up a local Intranet server, my "co-worker" (so to speak) told me about this thing called XAMPP and I downloaded it today. I accidently took off the Novell stuff on the server and had to get the Novell SUSE files back on. Once I got it back, I disabled Apache2 (took me a while to figure it out why XAMPP wasn't working blink.gif ) and got XAMPP fired up.

I noticed when I unpackaged the tar.gz file was that it seems to be like PHPTriad for Windows (XAMPP also has a Windows version) because it included Apache, PHP, MySQL and a bunch of mods like Pearl and CGI.

Now, using XAMPP, MySQL works! I don't know what the difference was between me trying to manually setup MySQL and XAMPP doing it, but XAMPP obviously did it the right way!

I feel kind of bad for wasting your time, but I did learn a lot! I am a little more comfortable on my Linux server now! Thanks! You're all great! smile.gif

[N]F
Go to the top of the page
 
+Quote Post
yordan
post Nov 12 2005, 01:54 PM
Post #10


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 2,242
Joined: 16-August 05
Member No.: 7,896
myCENTs:56.55



You're welcome. Like sometimes in real life, simply asking the question allowed you to get the problem solved, with help of a lucky strike. Let's be happy and celebrate this with you.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. MySQL - Trouble With Bulk Insert Statements(3)
  2. MySQL Realtime Replication(4)
  3. Recover Tables From A MySQL .frm File(8)
  4. Mirror My MySQL Database To Another Mysql Server(4)
  5. How To Connect MySQL With Flash?(8)
  6. MySQL Output Database Question(18)
  7. MySQL, Multiple Tables(24)
  8. Navcat For MySQL(9)
  9. Permission Problem With Mysql Database Creation(8)
  10. Mysql And Php(15)
  11. Login System Using A Mysql Db(5)
  12. Oracle Vs. Mysql Vs. Postgresql(9)
  13. Subqueries In Mysql(1)
  14. Apache Php With Mysql On Windows [solved](9)
  15. Mysql - So Hard(14)
  1. Mysql Problem(1)
  2. Sun Bought Mysql(6)
  3. Mysql Backup With Another Address?(4)
  4. I Have An Error With My Mysql Connection(7)
  5. Mysql And User File_priv(0)
  6. Mysql Database Management(1)
  7. Mysql Database Entry By Excel Sheets(2)
  8. Mysql On Computer(9)
  9. Database Access On Remote Server W/jsp(0)
  10. Any Website Provide Free Host Mysql Host?(4)
  11. Mysql Multiple Tables(1)
  12. Mysql Overhead(3)
  13. Login System(6)


 



- Lo-Fi Version Time is now: 5th December 2008 - 01:41 AM