Poll

how connect to database ?

aaa
0 (0%)
bbb
0 (0%)

Total Members Voted: 0

Author Topic: database  (Read 2514 times)

vicky

  • Guest
database
« on: July 05, 2006, 02:02:10 AM »
From Gambas Database Manager, I make a new connection (new server).
host : localhost
username : root
password : - (no password)
after that i klik '+' mark at root@localhost(mysql) that shown on Gambas Database Manager. but there is an error message 'cannot open database : can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'.
how to solve that problem ?

Linux Basic

database
« on: July 05, 2006, 02:02:10 AM »

timothy

  • Sr. Member
  • ****
  • Posts: 319
Re: database
« Reply #1 on: July 05, 2006, 03:35:16 AM »
Alas there are so many possible problems when it comes to communicating with a database that it is often difficult to fix over the Internet.

The error message looks like MySQL is not running. Open a terminal window and type:
  mysql -u<loginName>
in your case the login name should be mysql. (Never use root to log in to a database.) So type:
  mysql -umysql
do you get the same error message. If so then you need to start MySQL and also check the default databases have been initialised.

If MySQL has been installed by your Linux distribution then the simplest way to do this is to set the runlevel. Open system tool that sets the runlevel (sometimes called services). Find MySQL and set the runlevel to 5. Reboot your workstation. This will start MySQL every time you reboot the workstation. If the default databases are not setup then they will be created. Now try the mysql -umysql in a terminal again.

« Last Edit: July 05, 2006, 03:54:19 AM by timothy »
42 - So long and thanks for all the fish.