Page 1 of 1

after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 06:18
by cbook
i have installed xampp,and all the service are ok.
now,i want to login mysql by shell instruction,not by phpmyadmin.
how can i do?

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 09:34
by Wiedmann
http://dev.mysql.com/doc/refman/5.1/en/mysql.html
(This tool is located in /opt/lampp/bin.)

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 09:51
by cbook
Wiedmann wrote:http://dev.mysql.com/doc/refman/5.1/en/mysql.html
(This tool is located in /opt/lampp/bin.)


when i input mysql my db_name on terminal,the terminal output:"can not connect to loacl mysql through socket '/var/lib/mysql/mysql.sock'(2)"
how to resolve it .

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 10:03
by Wiedmann
Use the "mysql" tool from XAMPP, and not that one from your system.

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 10:59
by cbook
Wiedmann wrote:Use the "mysql" tool from XAMPP, and not that one from your system.

how to use the mysql tool from xampp?please teach me a bit.thank you!

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 11:19
by Wiedmann
how to use the mysql tool from xampp?

Wiedmann wrote:(This tool is located in /opt/lampp/bin.)

-->
Code: Select all
/opt/lampp/bin/mysql

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 11:26
by cbook
Wiedmann wrote:
how to use the mysql tool from xampp?

Wiedmann wrote:(This tool is located in /opt/lampp/bin.)

-->
Code: Select all
/opt/lampp/bin/mysql

i have try it ,the error is "can not connect to loacl mysql through socket '/opt/lampp/var/mysql/mysql.sock'(2)"

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 11:39
by Wiedmann
"can not connect to loacl mysql through socket '/opt/lampp/var/mysql/mysql.sock'(2)"

So you have to start the XAMPP MySQL server.

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 12:38
by cbook
Wiedmann wrote:
"can not connect to loacl mysql through socket '/opt/lampp/var/mysql/mysql.sock'(2)"

So you have to start the XAMPP MySQL server.

now ,i konw the different version using different instruction.
now if i want to query some information from the datatabe "user" belonged to the database "testor",i write the code as follows:
first step:"\r testor"
second step"select * from user"
……
the result is right.

but now i want to create a new database,how to write the code.
i can't find the instruction.

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 12:49
by Wiedmann
Maybe you want read:
Chapter 3. Tutorial http://dev.mysql.com/doc/refman/5.1/en/tutorial.html
:?:

Re: after install xampp,how to access mysql by terminal?

PostPosted: 02. September 2009 12:54
by cbook
i have resolved it by using the code "create database bugtracker",
only directly input it after"mysql>".
haha,thanks for your help.
good night, sir.