How do I start/stop mysql in XAMPP?

18,038

XAMPP itself isn't in the repos but MySQL, PHP, Apache and everything else that is included in XAMPP has a package. It can be done as simple as this:

sudo apt-get install lamp-server^

Note: The ^ on the end isn't a typo - it's how we denote tasks.

XAMPP includes some other things you you probably don't need but you can install most of a command like this (I suggest you only install the things you want, for performance):

sudo apt-get install phpmyadmin proftpd-basic openssl php5-ming php5-gd sqlite3 php5-sqlite php5-mcrypt webalizer php-pear

That affords you a fairly standard stack. The major differences between this and XAMPP are:

  • These are set up for production use - with fairly secure defaults
  • Apache and MySQL are set to run on boot - XAMPP runs when you tell it to.
  • You will get security updates for all these packages through Ubuntu's updater
  • You might have to fine tune some of the configuration for your needs

Once you're at that point, you can follow the standard documentation. It might be a little old but most of it should hold true.

Share:
18,038

Related videos on Youtube

norihide.shimatani
Author by

norihide.shimatani

Updated on September 18, 2022

Comments

  • norihide.shimatani
    norihide.shimatani over 1 year

    I installed XAMPP. Now the problems are

    • I can not start mysql
      root@ubuntu:/# sudo /opt/lampp/lampp startmysql
      XAMPP: Starting MySQL...
      XAMPP: Couldn't start MySQL!

    • I can not put my projects so i can test it
      /opt/lampp/htdocs/
      root@ubuntu:~# cp -r /home/sou/socialnetwork/* /opt/lampp/htdocs/SocialNetwork cp: cannot stat `/home/sou/socialnetwork/*': No such file or directory

    root@ubuntu:~# cp -r /home/sou/socialnetwork/* /opt/lampp/htdocs/SocialNetwork -bash: /home/sou/socialnetwork/*: No such file or directory -bash: /opt/lampp/htdocs/SocialNetwork: No such file or directory cp: missing file operand Try `cp --help' for more information.

    • phpMyAdmin can not work

    MySQL said: Documentation
    2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
    Connection for controluser as defined in your configuration failed.

    I just startted with Ubuntu 1day ago, so i dont know the staffs required to start XAMPP properly. please guide me !

    What i need

    • To start/stop MySQL
    • To open the directory and copy required files to it
    • To start phpMyAdmin
    • Oli
      Oli almost 13 years
      Why did you install XAMPP? Everything it provides is available from the standard repositories.
    • norihide.shimatani
      norihide.shimatani almost 13 years
      what do you mean by standard repositories ? i got 11.04, i also searched in Software center and tried to install from the console also, all failed
    • Michael Gundlach
      Michael Gundlach over 12 years
      @Sourav You can install Apache, MySQL, PHP, etc using tasksel. sudo apt-get install tasksel && sudo tasksel install lamp-server
  • norihide.shimatani
    norihide.shimatani almost 13 years
    root@ubuntu:~# sudo apt-get install tasksel Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package tasksel root@ubuntu:~# sudo tasksel install lamp-server sudo: tasksel: command not found root@ubuntu:~# sudo apt-get install phpmyadmin proftpd-basic openssl php5-ming php5-gd sqlite3 php5-sqlite php5-mcrypt webalizer php-pear Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package proftpd-basic E: Unable to locate package php5-gd ...
  • Oli
    Oli almost 13 years
    Run sudo apt-get update and try these again. If you're still not able to install something as basic as tasksel you've got fairly large problems, completely separate from this thread.