Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The XAMPP installation is done. XAMPP is up and running.

What about the MySQL console? How is possible to start the MySQL console to run some special SQL statements?

share|improve this question
Remember there are a lot better ways to deploy web server in Ubuntu than XAMPP. They're also easier and more reliable. Create a new question if you want to know the process. – Richard Rodriguez Jan 13 '12 at 20:29

just start mysql using the command

example: sudo /opt/lampp/lampp startmysql

and find path of mysql , it will be placed in bin directory of lampp, then login

example: /opt/lampp/bin/mysql -u root

share|improve this answer

From the terminal type mysql -uUSER -pPASSWORD DATABASE which is:

mysql The actual command to use mysql

-uUSER is what user will connect. The -u is the parameter for the user and the USER part is the actual name of the user.

-pPASSWORD is the password for that user. the -p is the parameter for the password and the PASSWORD is the actual password.

the DATABASE part is optional. Is just if you want to connect directly to a particular database. For example, let us say the user cyrex with password ubuntu wants to connect to the database linux, you would type this:

mysql -ucyrex -pubuntu linux (User is cyrex, password is ubuntu and the database is linux)

if you do not add the database you can eventually go to it by using the use statement of mysql or searching for the database with show databases;

share|improve this answer
+1: This is the usual solution, but I'm afraid that XAMPP doesn't actually deploy mysql like this. I don't use XAMPP so I'm not sure, but my friend has it and I hate its every bit. If my assumptions are true, your solution might not work for the OP, but it's still correct. – Richard Rodriguez Jan 13 '12 at 20:34

Maybe you're wondering about the package Apache Friends Xampp. The only way init is MySql

~$ sudo /opt/lampp/lampp startmysql

If it's something

share|improve this answer

The latest version of Xampp's Control Panel has a shell button, click that and it may show a dialog box saying that the #bat file needs to be created, and if it should create it now.. You should say Yes.

After that, it will open a console window. From that console window you can easily access mysql by typing the following.

mysql -u mysqluser --p mysqlpass

in my own personal installation i use the below (because i don't have a pass set for user @root).

mysql -u root

Btw, if it isn't obvious already I am using windows, so there could be some differences in the ubuntu version.

Hope this helps someone..

share|improve this answer

First use this command in shell (Ubuntu):

ubuntu@ubuntu-PowerEdge-2850:~$ sudo /opt/lampp/lampp startmysql 

Second use this command in shell (Ubuntu):

ubuntu@ubuntu-PowerEdge-2850:~$ /opt/lampp/bin/mysql -u root -p database < "/opt/lampp/htdocs/database.sql" 

Enter password: (Press Enter)

share|improve this answer
Why are you importing a database.sql file and the question was specific to just starting the console? – Parto Apr 1 at 9:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.