In this tutorial we will see the principles of how to install both MySQL Server and Client. We will install MySQL on a Debian system, so we need to make sure that our package management tools are up-to-date and also that we have installed all the latest available software.
About MySQL
MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack. LAMP is an acronym for “Linux, Apache, MySQL, Perl/PHP/Python.” Free-software-open source projects that require a full-featured database management system often use MySQL.
For commercial use, several paid editions are available, and offer additional functionality. Applications that use MySQL databases include: TYPO3, Joomla, WordPress, phpBB, MyBB, Drupal and other software built on the LAMP software stack. MySQL is also used in many high-profile, large-scale World Wide Web products, including Wikipedia, Google, Facebook, Twitter, Flickr, Nokia.com and YouTube.
(Note: For the Purpose of this tutorial we will use Debian as the OS and the latest installation of mysql-server and mysql-client. There are no guarantees or absolutes for mysql security things, so proceed at your own risk.)
Installing MySQL Server and Client
We will install the current version of phpMyAdmin on our system using the following command:
apt-get install mysql-server mysql-client
We will be asked from Package Configuration to provide a password for the root user.
Image may be NSFW.
Clik here to view.
When the installation is complete, we have a MySQL database ready for configuration.
Installing PHP5 – MySQL
In this step we will install php5-mysql to make MySQL available to PHP, so type:
apt-get install php5-mysql
How to Start, Stop and Restart MySQL
/etc/init.d/mysql status /etc/init.d/mysql start /etc/init.d/mysql restart /etc/init.d/mysql stop
or using the service command
service mysql start service mysql stop service mysql restart service mysql status
How to connect to MySQL
We can access our database by typing the following command:
mysql -u root -p
(Note: -u specifies the user, -p prompt for root user password)
Conclusion
This tutorial describes the basic commands to install MySQL and how you can have access to your database. Also some basic information on how to re-start/stop MySQL.
Designed and Created by Liatsis Fotis for liatsisfotis.com
© 2013 Liatsis Fotis
Clik here to view.
