0

After I installed Apache2, MySQL, MySQL Client, phpMyAdmin and PHP on my Ubuntu 13.10, I tested the Apache2 using 127.0.0.1 and it works. I would like to learn how I can access MySQL and create PHP scripts for my testing website and upload to a web server.

Your help and information is greatly appreciated.

1 Answer 1

0

You can access MySQL from command line by typing in a terminal:

mysql -u [username] -p [password]

where [username] is the user you setup during install and [password] is the password for that user. If the password has special characters (such as $ or !) then you can leave the -p blank and it will prompt you for the password.

As far as phpMyAdmin, you need to edit the default Apache2 conf (usually located at /etc/apache2/apache2.conf or /etc/apache2/apache.conf). Make a backup (cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bak) add these lines to the end of apache2.conf:

# Include phpmyadmin

Include /etc/phpmyadmin/apache.conf

Save the file. Then, restart Apache2 with:

service apache2 restart

Now, you should be able to access phpMyAdmin by typing http://localhost/phpmyadmin in the address bar of your browser. I hope this helps.

5
  • Thanks for the information I got permission denied when I tried to copy the file to backup cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bak Regards, Inung Apr 22, 2014 at 1:42
  • I got unknown database when I enter mysql -u [username] -p [password] Apr 22, 2014 at 1:44
  • Sorry, you need to do all these commands as sudo or as root.
    – ChrisR.
    Apr 22, 2014 at 2:00
  • Thanks for the information and help, are there any way to use WorkBench? should I just upload myfile.php file to /etc/apache2? Thanks again for helping, Regards, Inung Apr 22, 2014 at 2:16
  • If you are wanting to make a php file (like a page on the webserver) you can add it to the whatever the root directory of the website is (usually /var/www/). After that, my knowledge of this subject is mostly exhausted.
    – ChrisR.
    Apr 22, 2014 at 3:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .