Connect to mysql

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Connect to mysql

Postby tirengarfio » 08. March 2009 20:32

Hi,

i have read to connect to the mysql data base i have to write something like this:

shell> mysql -h ServerName -u UserName -p

But what is the exactly command in XAMPP?

Bye
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 08. March 2009 21:29

shell> mysql -h ServerName -u UserName -p

With this command you are using the mysql binary from your system, and not that one from XAMPP which is in "/opt/lampp/bin".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 09. March 2009 10:38

Wiedmann wrote:
shell> mysql -h ServerName -u UserName -p

With this command you are using the mysql binary from your system, and not that one from XAMPP which is in "/opt/lampp/bin".


Thanks i am typing from "/opt/lampp/bin".

Im trying this:

/opt/lampp/bin/mysql -u tirengarfio -p (being "tirengarfio" the login to access my session in Ubuntu.)

and after i'm requested to write a password and i write the password to access my session in Ubuntu, and i get this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 09. March 2009 11:07

/opt/lampp/bin/mysql -u tirengarfio -p (being "tirengarfio" the login to access my session in Ubuntu.)

MySQL is not using your system users. In a fresh XAMPP installation, you have e.g. a MySQL user "root".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 09. March 2009 13:13

Wiedmann wrote:MySQL is not using your system users. In a fresh XAMPP installation, you have e.g. a MySQL user "root".


Thanks, but are you speaking about the root user of my system, or is another root user (maybe the root user of MySQL o XAMPP)?
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 09. March 2009 14:24

but are you speaking about the root user of my system

Wiedmann wrote:MySQL is not using your system users


or is another root user (maybe the root user of MySQL o XAMPP)?

Wiedmann wrote:In a fresh XAMPP installation, you have e.g. a MySQL user "root".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 09. March 2009 16:52

Ok, thanks.

I have tried it with:

/opt/lampp/bin/mysql -u root -p

but i password is requested, what is that password?
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 09. March 2009 17:05

but i password is requested, what is that password?but i password is requested, what is that password?

Ever read some docu?
--> http://www.apachefriends.org/en/xampp-linux.html#381
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 09. March 2009 18:07

Wiedmann wrote:
but i password is requested, what is that password?but i password is requested, what is that password?

Ever read some docu?
--> http://www.apachefriends.org/en/xampp-linux.html#381


Thanks, so if the "root" doesnt have password..I try this:

./mysql -u root -p

and when it asks me for a password i press the enter key and the error is this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

and i have also tried this:

./mysql -u root

and the error is the same.
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 09. March 2009 18:14

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

Sure MySQL is running?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 14. March 2009 20:37

Wiedmann wrote:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

Sure MySQL is running?



tirengarfio@tirengarfio-laptop:/opt/lampp/bin$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.7...
XAMPP: XAMPP-Apache is already running.
XAMPP: Starting MySQL...
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
tirengarfio@tirengarfio-laptop:/opt/lampp/bin$ ./mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
tirengarfio@tirengarfio-laptop:/opt/lampp/bin$ ./mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
tirengarfio@tirengarfio-laptop:/opt/lampp/bin$
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 14. March 2009 20:41

If you want know if MySQL is running, you must use e.g. "ps" or look into the "*.err" file from MySQL.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 14. March 2009 20:56

Wiedmann wrote:If you want know if MySQL is running, you must use e.g. "ps" or look into the "*.err" file from MySQL.


Thanks again, this is my ps list after run "/opt/lampp/lampp start":

Code: Select all
tirengarfio@tirengarfio-laptop:/opt/lampp$ ps -A
  PID TTY          TIME CMD
    1 ?        00:00:01 init
    2 ?        00:00:00 kthreadd
    3 ?        00:00:00 migration/0
    4 ?        00:00:00 ksoftirqd/0
    5 ?        00:00:00 watchdog/0
    6 ?        00:00:00 events/0
    7 ?        00:00:00 khelper
   41 ?        00:00:00 kblockd/0
   44 ?        00:00:00 kacpid
   45 ?        00:00:00 kacpi_notify
   87 ?        00:00:00 kseriod
  120 ?        00:00:00 pdflush
  121 ?        00:00:00 pdflush
  122 ?        00:00:00 kswapd0
  163 ?        00:00:00 aio/0
 1366 ?        00:00:02 ata/0
 1370 ?        00:00:00 ata_aux
 1383 ?        00:00:00 scsi_eh_0
 1385 ?        00:00:00 scsi_eh_1
 2327 ?        00:00:00 kjournald
 2532 ?        00:00:00 udevd
 2741 ?        00:00:00 kpsmoused
 3966 tty4     00:00:00 getty
 3967 tty5     00:00:00 getty
 3972 tty2     00:00:00 getty
 3974 tty3     00:00:00 getty
 3977 tty6     00:00:00 getty
 4020 ?        00:00:00 vboxadd-timesyn
 4188 ?        00:00:00 acpid
 4230 ?        00:00:00 kondemand/0
 4295 ?        00:00:00 syslogd
 4344 ?        00:00:00 dd
 4346 ?        00:00:00 klogd
 4368 ?        00:00:00 dbus-daemon
 4384 ?        00:00:00 NetworkManager
 4398 ?        00:00:00 NetworkManagerD
 4411 ?        00:00:00 system-tools-ba
 4431 ?        00:00:00 avahi-daemon
 4432 ?        00:00:00 avahi-daemon
 4461 ?        00:00:00 cupsd
 4557 ?        00:00:00 dhcdbd
 4576 ?        00:00:00 hald
 4579 ?        00:00:00 console-kit-dae
 4641 ?        00:00:00 hald-runner
 4653 ?        00:00:00 hald-addon-inpu
 4662 ?        00:00:00 hald-addon-acpi
 4663 ?        00:00:00 hald-addon-stor
 4670 ?        00:00:02 hald-addon-stor
 4710 ?        00:00:00 hcid
 4719 ?        00:00:00 btaddconn
 4720 ?        00:00:00 btdelconn
 4731 ?        00:00:00 bluetoothd-serv
 4732 ?        00:00:00 bluetoothd-serv
 4737 ?        00:00:00 krfcommd
 4778 ?        00:00:00 dhclient
 4787 ?        00:00:00 gdm
 4788 ?        00:00:00 gdm
 4794 tty7     00:02:49 Xorg
 4844 ?        00:00:00 atd
 4858 ?        00:00:00 cron
 4945 tty1     00:00:00 getty
 5028 ?        00:00:02 gconfd-2
 5030 ?        00:00:00 gnome-keyring-d
 5031 ?        00:00:00 x-session-manag
 5086 ?        00:00:00 seahorse-agent
 5094 ?        00:00:00 dbus-daemon
 5095 ?        00:00:03 gnome-settings-
 5099 ?        00:00:01 pulseaudio
 5100 ?        00:00:00 gconf-helper
 5114 ?        00:00:12 gnome-screensav
 5115 ?        00:00:08 metacity
 5117 ?        00:00:08 gnome-panel
 5118 ?        00:00:03 nautilus
 5127 ?        00:00:00 bonobo-activati
 5146 ?        00:00:00 gvfsd
 5150 ?        00:00:00 bluetooth-apple
 5152 ?        00:00:00 update-notifier
 5156 ?        00:00:00 evolution-alarm
 5157 ?        00:00:00 tracker-applet
 5163 ?        00:00:04 trackerd
 5167 ?        00:00:00 python
 5168 ?        00:00:03 nm-applet
 5170 ?        00:00:00 gnome-power-man
 5171 ?        00:00:00 gnome-volume-ma
 5177 ?        00:00:10 VBoxClient
 5249 ?        00:00:00 evolution-data-
 5254 ?        00:00:00 evolution-excha
 5256 ?        00:00:00 gvfsd-burn
 5259 ?        00:00:00 trashapplet
 5266 ?        00:00:00 gvfsd-trash
 5313 ?        00:00:01 deskbar-applet
 5316 ?        00:00:00 fast-user-switc
 5320 ?        00:00:00 mixer_applet2
 5331 ?        00:00:00 gnome-vfs-daemo
 5347 ?        00:03:21 firefox
 5389 ?        00:00:01 notification-da
 5406 ?        00:00:00 gtk-gnash <defunct>
 5418 ?        00:00:06 gnome-terminal
 5420 ?        00:00:00 gnome-pty-helpe
 5421 pts/0    00:00:00 bash
 5474 ?        00:00:00 httpd
 5534 ?        00:00:00 proftpd
 5565 ?        00:00:00 httpd
 5597 ?        00:00:00 httpd
 5601 ?        00:00:00 httpd
 5603 ?        00:00:00 httpd
 5605 ?        00:00:00 httpd
 5608 ?        00:00:00 httpd
 6001 ?        00:00:00 gvfsd-computer
 6008 ?        00:00:07 file-roller
 6318 pts/0    00:00:00 ps


i think mysql is not in the list, why if i started lampp? how can i run mysql if it is not running?
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Re: Connect to mysql

Postby Wiedmann » 14. March 2009 21:26

i think mysql is not in the list,

Look into the MySQL "*.err" file what's the problem.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Connect to mysql

Postby tirengarfio » 14. March 2009 22:42

Wiedmann wrote:Look into the MySQL "*.err" file what's the problem.


This is my "*.err" file:

Code: Select all
090305 11:40:43 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090305 11:40:44 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090305 11:40:45  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090305 11:40:45 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090306 12:34:02 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090306 12:34:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090306 12:34:04  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090306 12:34:04 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090307 22:33:50 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090307 22:33:51 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090307 22:33:51  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090307 22:33:51 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090308 20:08:11 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090308 20:08:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090308 20:08:11  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090308 20:08:11 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090314 20:35:10 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090314 20:35:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090314 20:35:11  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090314 20:35:11 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090314 20:36:30 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090314 20:36:30 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090314 20:36:31  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090314 20:36:31 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended
090314 20:42:44 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
090314 20:42:44 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090314 20:42:44  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
090314 20:42:44 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/tirengarfio-laptop.pid ended

I thought i should execute "mysql_upgrade" but when i do it i get the same error as before

Code: Select all
tirengarfio@tirengarfio-laptop:/opt$ /opt/lampp/bin/mysql_upgrade
Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored
Looking for 'mysql' as: /opt/lampp/bin/mysql
Looking for 'mysqlcheck' as: /opt/lampp/bin/mysqlcheck
Running 'mysqlcheck'...
/opt/lampp/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed
tirengarfio
 
Posts: 30
Joined: 19. October 2008 18:28

Next

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests