0% found this document useful (0 votes)
3 views

MySQL Help

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

MySQL Help

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Run MySQL in XAMPP

Open MySQL shell

• You can start the MySQL shell from Applications menu. To launch MySQL shell, choose
◦ Applications → Programming → Mysql
• Now you can see a terminal window asking for password to continue ,
By default no password is set for MySQL root user in XAMPP. So, here you just hit Enter
key.

Once you set a password for MySQL root user, you should provide that password to
continue. (When passwords are typed in terminal window, nothing will be displayed)

If lampp (XAMPP) is not running in you computer you can't start MySQL in this way.
Then you have to start lampp manually.

1
To start lampp, open a terminal and run the following command.
sudo /opt/lampp/lampp start
You can open 'terminal', in three ways.
1. Press Ctrl+Alt+T,
2. Applications → Accessories → Terminal
3. Right click on Desktop or in the working folder and choose 'Open in Terminal' from the
context menu

Start MySQL shell in command line

• To access MySQL shell simply run the following command in terminal

/opt/lampp/bin/mysql -uroot

• If you have set password to MySQL then run the following command in a terminal:

/opt/lampp/bin/mysql -u<username> -p<password)

Eg. /opt/lampp/bin/mysql -uroot -proot ( here, username and password are 'root')

Edit or remove 'lampp'

If you want to edit or remove your lampp files, you have to stop the XAMPP before doing so.
• To start lampp, open a terminal and run the following command.
sudo /opt/lampp/lampp stop

XAMPP is installed in in the directory /opt/lampp. You can access this directory in the following
way.
Places → Computer → File System → opt → lampp

2
Renaming your XAMPP directory, if needed

To Rename the lampp directory,

◦ Go to Places → Computer → File System → opt


◦ Then open a terminal in the folder 'opt' ( right click → Open in Terminal )
◦ Run the command sudo mv lampp lampp_old ( give your administrative user
password and press enter)

How to back up the lampp

To backup your lampp directory (which is situated in the opt directory of the your File
System and it contains the web site and databases you created),
• open the folder lampp_files in your HOME.
• Double click the file lampp-backup.sh and click Run in Terminal.
• Then a box will appear asking your password. Give administrative password of your
system and press OK .

Now a folder named lampp-backup will be created here.

3
In this lampp-backup folder you can see the compressed lampp as lampp.tar.gz and the
script lampp-install.sh to install it in other computers

Install / Restore the backed up lampp

• Copy the file 'folder named lampp-backup to the computer where the lampp is to be
installed.

• Open the folder and set execute permission to the file install-lampp.sh, if needed.
• Run the script 'install-lampp.sh' (double click → Run in Terminal)
• If you want lampp to start automatically on boot run the script 'lampp-start-at-boot.sh'

Set passwords to XAMPP

In the default installation, XAMPP has no passwords set and it is not recommended to run
XAMPP with this configurations. To make XAMPP secure, passwords are to be set.
• To set passwords to XAMPP , run the following commands
sudo /opt/lampp/lampp start ( to start XAMPP)
sudo /opt/lampp/lampp security and follow the instructions displayed.

You might also like