Installing and configuring phpMyAdmin. Installing PhpMyAdmin Ubuntu on Nginx or Apache Installing phpmyadmin ubuntu from archive

— local server for Linux. Unfortunately, the phpMyAdmin database administration tool is not included in the LAMP toolkit and must be installed separately. This article will teach you how to use phpMyAdmin.

Installing phpMyAdmin on Ubuntu

Very often, phpMyAdmin (PMA) is found on paid hosting services and is used to create and administer website databases. There is no need to install it on paid hosting - everything is already done there before you. Most often, you will encounter installing PMA on your computer to administer local server databases. As an example I'll look at installing phpMyAdmin on Ubuntu is one of the most popular Linux distributions.

Open a terminal and enter the following command:

sudo apt-get install phpmyadmin

After that, enter the administrator password and agree to continue with the installation.

Select a web server that will be automatically configured to run PMA. In our case it is apache2.

Agree to configure the database using dbconfig-common.

Enter the MySQL administrator password.

Set a password to register PMA on the database server and then confirm it. After installation is complete, phpMyAdmin will be available at http://localhost/phpmyadmin.

phpMyAdmin is not working

If you go to this address and see an error page, you can do the following.

  • enter the command in the terminal:
    sudo ln - s / etc/ phpmyadmin/ apache. conf /etc/apache2/conf. d
  • restart the apache server using the command:
    sudo /etc/init. d/ apache2 restart
  • Revisit http://localhost/phpmyadmin and you should now see the phpMyAdmin admin login page.

The user will be root and the password you set during installation.

Creating a new database

Having passed authentication, we get to the PMA start page, where you can select the interface language, if you have not done this before, view information about the database management system MySQL data and the web server you are using. The left column shows all available databases.

What will come in handy first? Of course, the ability to create a database for a future website. To do this, go to the Databases tab.

Just enter the name of the new database and click on the “Create” button - phpMyAdmin will do the rest automatically.

A message indicating the successful creation of the database will appear and it will be added to the list below.

Adding a new database user

Having created a new database, you also need to add a user who could use it.

To do this, click on the inscription “Check privileges”. You will be redirected to the “Users with access rights to the database” page, on which you should click on “Add a new user”.

In the "Information" section account"Indicate the username (in English letters), host (on the local server - localhost) and password.

Just below you need to set privileges for the new user. On a local server, you can tick all the boxes without hesitation. After this, click on the “OK” button at the very bottom and New user will be created.

Import and export of databases

To create a backup ( backup copy) of the database is the “Export” section.

In the case of the “fast” export method, backups of all available databases will be created at once in the format selected below.

PhpMyAdmin is the most popular web-based MySQL database management tool. An indispensable tool for everyone who is not familiar with the MySQL server command language.

For phpMyAdmin to work, you must already have it installed and working.

  • MySQL server
  • Http server with php support

Installation on Ubuntu

Installation is performed with the command

Sudo aptitude install phpmyadmin

The installer will ask which http server we are installing on - I chose apache2, because... he was already standing with me. Next, the installation script asked to create and configure the phpmyadmin database - we agree and enter the user and password to manage this database.
After installation, all configs are stored in /etc/phpmyadmin. Just in case, restart the http server.

Sudo /etc/init.d/apache2 restart

In the browser we enter http://localhost/phpmyadmin/ and log in as MySQL server users.

Installation from source

To give you an idea of ​​what happens when you install phpMyAdmin, I'll show you what the installation scripts for many distributions do. In addition, the installation method from source is universal and suitable for all Unix systems.
1. Download the latest version of phpMyAdmin from the official website (as of today latest version was 3.3.8).
2. Unpack the downloaded archive into any folder in the root directory of our http server. For convention, let this be the phpmyadmin folder.
3. Find it in the folder phpmyadmin/scripts the create_tables.sql file is a dump of the phpmyadmin table. Let's restore it with a command from root or sudo

#mysql -u root -p< create_tables.sql

4. We go to the MySQL server console and set the rights to the newly created phpmyadmin database.

# mysql -u root -p mysql> use phpmyadmin; mysql> GRANT ALL ON phpmyadmin.* TO phpmyadmin@localhost IDENTIFIED BY "your_password"; mysql> flush privileges;

5. Edit the configuration file in the root phpmyadmin folder - config.sample.inc.php.
Rename it to config.inc.php, set the owner of the file to the one from whom the http server is running (for me this is the user nobody) and set the file permissions to 600 (we perform these actions as root or sudo)

#mv config.sample.inc.php config.inc.php #chown nobody config.inc.php #chmod 600 config.inc.php

In the file itself config.inc.php change the value of the lines - enter the password for authorization via cookie and the user name, password for the phpmyadmin database restored from the dump.

$cfg["blowfish_secret"] = "password"; /* User for advanced features */ $cfg["Servers"][$i]["controluser"] = "phpmyadmin"; $cfg["Servers"][$i]["controlpass"] = "your_password";

and let’s uncomment these lines

/* Advanced phpMyAdmin features */ $cfg["Servers"][$i]["pmadb"] = "phpmyadmin"; $cfg["Servers"][$i]["bookmarktable"] = "pma_bookmark"; $cfg["Servers"][$i]["relation"] = "pma_relation"; $cfg["Servers"][$i]["table_info"] = "pma_table_info"; $cfg["Servers"][$i]["table_coords"] = "pma_table_coords"; $cfg["Servers"][$i]["pdf_pages"] = "pma_pdf_pages"; $cfg["Servers"][$i]["column_info"] = "pma_column_info"; $cfg["Servers"][$i]["history"] = "pma_history"; $cfg["Servers"][$i]["tracking"] = "pma_tracking"; $cfg["Servers"][$i]["designer_coords"] = "pma_designer_coords";

Now you can type in the browser http://localhost/phpmyadmin/ and log in.

Solving problems when installing phpMyAdmin

1. When opened by a browser, phpMyAdmin does not open, but offers to download the page.
The solution is to configure php support on the http server. In apache, the php module is connected in httpd.conf lines,

LoadModule php5_module modules/libphp5.so

of course php must be installed after the change httpd.conf restart apache server

Mysql -u user -p

3.
Unable to load mcrypt extension! Check your PHP settings.
Solution - make sure that the application is installed on your system mcrypt and library libmcrypt, and the php module for the http server was built with the variable

With-mcrypt

4. After authorization an error occurs:
When working with multibyte encodings without installed extension PHP "mbstring", phpMyAdmin is unable to properly split strings, which can lead to unpredictable results. Install the PHP extension "mbstring".
The solution is to rebuild the php module for the http server with the parameter

Enable-mbstring

or uncomment in php.ini line

Extension=mbstring.so

5. After logging into phpMyAdmin we see a warning:
When using cookie authentication, you must specify a passphrase in the configuration file by setting the value of the $cfg["blowfish_secret"] directive.
The solution is in the phpMyAdmin configuration file - config.inc.php set the password in the line

$cfg["blowfish_secret"]

If you have or have had other errors during installation or configuration, please write in the comments and we will add details..

Article viewed 70,037 times

Today we will look at the installation process of a very popular web application phpMyAdmin, which is used for administration MySQL DBMS, we will install it on operating system Linux Mint 18.2.

Let me remind you that earlier in the material “Installing and configuring MySQL server and MySQL Workbench on Linux Mint 18.2” we looked at the installation of the MySQL DBMS and the client application MySQL Workbench, which has GUI, but many administrators use, as I already said, a very popular web application for working with MySQL, phpMyAdmin, so now, especially for beginners, I will describe in detail the process of installing phpMyAdmin on Linux Mint 18.2.

As always, we will look at installation using a graphical tool ( program manager), and using the Linux terminal.

phpMyAdmin is a free web application with a graphical interface for administering the MySQL DBMS ( MariaDB support is also available). phpMyAdmin was developed using the PHP language and since this is a web application, a web server is required for its functioning, for example, Apache or Lighttpd. The phpMyAdmin application is popular all over the world and it has currently been translated into 72 languages, including Russian.

With phpMyAdmin you can:

  • View databases and tables;
  • Create, copy, rename, modify and delete databases;
  • Create, copy, rename, modify and delete tables;
  • Add, edit and delete fields in tables;
  • Execute SQL queries;
  • Create, modify and delete indexes;
  • Load text files into tables;
  • Create and read dumps of tables and databases;
  • Export data to SQL, CSV, XML, Word, Excel, PDF and LaTeX formats;
  • Manage MySQL users and privileges;
  • And also much more.

Installing phpMyAdmin on Linux Mint 18.2

As I already said, we will look at two ways to install phpMyAdmin, and we will start with a simple method suitable for beginners, i.e. using the program manager graphical interface.

On a note! If you want to learn how to use Linux on home computer without use command line, then I recommend reading my book - “ »

Installing phpMyAdmin using the program manager

In order to install phpMyAdmin, you must first install a Web server, such as Apache. Therefore, now we will first install Apache and only then phpMyAdmin.

Open the program manager, for example, “ Menu->Program Manager" or " Menu->Administration->Program Manager».

Enter the computer administrator password.


Web installation Apache server

In the program manager, enter Apache in the search and press Enter. Then find Apache2 in the search results and double-click on it.



The installation is complete when the window displays “ Installed».


Installing phpMyAdmin

To install phpMyAdmin in exactly the same way, enter phpMyAdmin into the search and press Enter. Most likely, only one program will be found, which is what we need, double-click on it.



During the installation process you will be asked which web server you will use, since we have already installed Apache, accordingly we answer Apache and click “ Forward».


Then there will be a question about the phpMyAdmin database, i.e. if we want to configure it, we leave the checkbox and click “ Forward».


As a setup, we are asked to come up with and enter a password for the phpMyAdmin database, we enter and click “ Forward", then confirm it and also click " Forward» ( The password should be quite complex, although you will rarely need it).



The installation is complete when the message “ Installed" After this, you can immediately check the operation of phpMyAdmin.


Installing phpMyAdmin using terminal

To launch the Linux terminal, click, for example, on the link on the panel or launch it from the Mint menu.


Installing programs, including phpMyAdmin, must be done as root, so let's switch to this user right away. To do this, write the command sudo -i (or sudo su) and press Enter ( input), then enter the user password.

Then we need to update the list of packages, for this we write a command.

apt-get update

Then, as in the case of the program manager, we need to first install the Apache web server, to do this we enter the following command.

Apt-get -y install apache2


Apt-get -y install phpmyadmin


During the installation process we will be asked which web server we will use, we select Apache and click " Enter».


Then we need to configure the phpMyAdmin database, select “ Yes" and click " Enter».


Then we come up with and enter a password for the phpMyAdmin database, click “ Enter", in the next window we confirm the password, i.e. enter it again and press “ Enter».



After this, the installation will be completed.

Configuring Apache to work with phpMyAdmin

If we install phpMyAdmin using the terminal, then in this case, unlike the graphical installation using the program manager, we need to manually connect the phpMyAdmin configuration file ( those. phpmyadmin settings file).

To do this, we write a command (with root rights), with which we will create a symbolic link in the directory with Apache configuration files.

Ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

Then we will enable this configuration file.

A2enconf phpmyadmin

Restart Apache

Systemctl restart apache2


That's it, after this you can proceed to checking the operation of phpMyAdmin.

If necessary, this configuration file can be disabled; for this purpose, there is the a2disconf command. After the Web server, Apache also needs to be restarted.

By the way, you can connect this configuration file in another way, for example, directly register the connection in the apache2.conf file, this method often found on the Internet, but the first option in this case is more correct. To edit apache2.conf, run the command (as root).

Nano /etc/apache2/apache2.conf

Add the following line to the end of the file.

Include /etc/phpmyadmin/apache.conf

We save the file with the keyboard shortcut Ctrl+O and press Enter, then close it also with the keyboard shortcut Ctrl+X only. Apache in this case also needs to be restarted

Systemctl restart apache2

Checking the operation of phpMyAdmin, connection to MySQL

In order to check the operation of phpMyAdmin, let's launch any browser and type the following address in the address bar ( This local address phpMyAdmin).

http://localhost/phpmyadmin

If you see the phpMyAdmin welcome page, then everything is fine, in other words, both the web server and phpMyAdmin are working.

To connect to the MySQL server, enter your username and password; for example, I will connect as root ( although as you know, working as root is not recommended).


After logging in you will be taken to home page phpMyAdmin, where you can see the list of databases on the server and the basic settings of the MySQL server.


Uninstalling phpMyAdmin in Linux Mint 18.2

You can remove phpMyAdmin either using the program manager or using the terminal. Let's look at both methods as well.

Uninstalling phpMyAdmin using Program Manager

Open the program manager, and in the same way as during installation, find phpMyAdmin. After you open phpMyAdmin in the program manager, you need to click on the “ Delete».


During the removal process, we will be asked if we want to delete the phpMyAdmin database settings, we leave the checkbox, i.e. delete the settings, click " Forward».


Then there will be a question whether we want to delete the phpMyAdmin database, we check the box and click “ Forward", i.e. We will delete the phpMyAdmin database as we no longer need it ( If you need it accordingly, then you do not check the box).


The phpMyAdmin field will be removed. Now we can disable the phpMyAdmin configuration file in the Apache web server settings. To do this, in the terminal we need to run the command ( with superuser rights).

A2disconf phpmyadmin

And restart Apache

Systemctl restart apache2


If you do not need the Apache web server, then you, like phpMyAdmin, can remove it using the program manager.


During the Apache removal process, you will not have any additional questions.

Uninstalling phpMyAdmin using Terminal

To remove phpMyAdmin using terminal, we have to launch it accordingly. Then we get root rights using sudo -i (or sudo su), since the deletion must be done with superuser rights.

To remove only phpMyAdmin, we need to first disable the phpMyAdmin configuration file. To do this, as before, we write the following command and restart Apache.

A2disconf phpmyadmin systemctl restart apache2

To remove phpMyAdmin we use the following command.

Apt-get -y --purge remove phpmyadmin

Key --purge means that we want to remove packages along with their configuration files.

During the removal process we will be asked if we want to delete the phpMyAdmin database settings, we answer “ Yes" and click " Enter».


Then, when asked about deleting the phpMyAdmin database, we also answer “ Yes", as I already said, unless of course you need it.


As a result, phpMyAdmin will be deleted.


To remove the Apache web server, write the following command.

Apt-get -y --purge remove apache2

To remove all related packages that we no longer need, we need to use the following command, thereby we can free up disk space.

Apt-get -y autoremove


That's all, I hope the material was useful to you, good luck!

is a LAMP application created specifically for administration MySQL servers. Written in PHP and accessible via a web browser, phpMyAdmin provides a graphical interface for database administration tasks.

Installation

Before installing phpMyAdmin, you will need access to the MySQL database on the same computer where you are installing phpMyAdmin, or on a remote computer accessible over the network. See the section for details. To install in the terminal, enter:

Sudo apt-get install phpmyadmin

When prompted, select which web server will be configured for phpMyAdmin. This section assumes use as a web server Apache2.

In your browser, go to http:// servername, replacing servername to the current server address. On the login page, enter root as the username, or another user if you configured one, and the MySQL password for that user.

Settings

The phpMyAdmin configuration files are located in /etc/phpmyadmin. The main settings file is /etc/phpmyadmin/config.inc.php. This file contains configuration options that apply to phpMyAdmin globally.

To use phpMyAdmin to manage MySQL on another server, set up the following entry in /etc/phpmyadmin/config.inc.php:

$cfg["Servers"][$i]["host"] = "db_server";

Replace db_server to the current IP address remote server Database. Also make sure that the computer with phpMyAdmin has access rights to the remote database.

After setup, log out of phpMyAdmin and log in again and you will have access to the new server.

The config.header.inc.php and config.footer.inc.php files are used to add header and footer HTML for phpMyAdmin.

Website creation on CMS Joomla!

php-myadmin.ru following link. At the time of writing, release 3.4.9 was available. Stopping Apache. Create a directory C:\www\htdocs\phpmyadmin and unpack our archive into it. Please note that archive files and folders can be combined into the phpMyAdmin-3.4.9-all-languages ​​folder. It is necessary that the contents of the phpMyAdmin-3.4.9-all-languages ​​folder be in the directory C:\www\htdocs\phpmyadmin, and not this folder itself. Then in the directory C:\www\htdocs\phpmyadmin (this is our phpMyAdmin root directory) we create a file called config.inc.php and, depending on our preferences, fill it with the following content:

$cfg["Servers"][$i]["host"] = "localhost";

$cfg["Servers"][$i]["extension"] = "mysqli";

$cfg["Servers"][$i]["connect_type"] = "tcp";

$cfg["Servers"][$i]["compress"] = false;

$cfg["Servers"][$i]["auth_type"] = "config";

$cfg["Servers"][$i]["user"] = "root";

$cfg["Servers"][$i]["password"] = "password";

In the first case, logging into phpMyAdmin will be “automatic”, i.e. you do not need to enter your login and password. In the last line, you need to replace the word password with your password, which was specified when installing MySQL. This case has, in my opinion, a significant drawback - the root user password is stored in clear text.

In the second case, you will need to log in every time you need to use phpMyAdmin. This case is closer to me. In line $cfg["blowfish_secret"] A passphrase of up to 46 characters must be recorded. We launch Apache, in the address bar of the browser (cookies must be enabled) we type http://localhost/phpmyadmin and get to the authorization page. We go through authorization and get to the main phpMyAdmin window.

In the main window we will see a message stating that additional features are not fully configured. We will enable additional features, as they allow you to work with bookmarks, histories of entered commands, a designer of linked tables, and pdf diagrams. To do this, we will use a ready-made sql query, as a result of which the “phpmyadmin” database will be created into which the necessary tables will be imported. Click on the “Import” tab, on the page that opens, in the “Imported file” section, click the “Browse...” button, select the create_tables.sql file, which is located in the scripts folder, in the phpmyadmin directory, and click the “OK” button located in bottom of the page. If everything went well, we receive the message: “Import completed successfully, queries completed: 12. (create_tables.sql).” After this, we create a special user named pma. The username does not have to be pma - this name is used as an example. Go to the “Privileges” tab and click on the “Add new user” link. Fill out the form that appears:

Click the “Create User” button. Click on the “Show all” link, thereby updating the list of users. In the pma user line, click on the “Edit privileges” link. In the window that opens, in the “Database level privileges” section, select the “phpmyadmin” database from the drop-down list. A new page will open, and in the “Database Level Privileges” section, in the “Data” group, check the boxes next to the options: SELECT, INSERT, UPDATE, DELETE and click “OK”. We receive a message that the privileges for the user "pma"@"localhost" have been changed. Close phpMyAdmin and edit the config.inc.php file. As a result of editing we get the following:

$cfg["blowfish_secret"] = "31h15u8gr7wq99.24633480"; $i=0; $i++; $cfg["Servers"][$i]["auth_type"] = "cookie"; $cfg["Servers"][$i]["pmadb"] = "phpmyadmin"; $cfg["Servers"][$i]["relation"] = "pma_relation"; $cfg["Servers"][$i]["table_info"] = "pma_table_info"; $cfg["Servers"][$i]["table_coords"] = "pma_table_coords"; $cfg["Servers"][$i]["bookmarktable"] = "pma_bookmark"; $cfg["Servers"][$i]["pdf_pages"] = "pma_pdf_pages"; $cfg["Servers"][$i]["column_info"] = "pma_column_info"; $cfg["Servers"][$i]["history"] = "pma_history"; $cfg["Servers"][$i]["tracking"] = "pma_tracking"; $cfg["Servers"][$i]["designer_coords"] = "pma_designer_coords"; $cfg["Servers"][$i]["userconfig"] = "pma_userconfig"; ?>

Let's delete the browser cache and go to phpMyAdmin. There is no warning about additional features, which means everything is configured correctly and is fully functional.

On this phpMyAdmin setup finished. You can proceed to installing Joomla 2.5

More articles about Joomla 2.5

    • The installation of phpMyAdmin is written based on materials from the site php-myadmin.ru. I recommend this site to anyone who wants to understand all the intricacies of working with phpMyAdmin. Download the file archive phpMyAdmin-3.4.9-all-languages.7z from the following link. At the moment...

    • In this article we continue to talk about CMS Joomla 2.5. Namely, about creating a backup of the site. In the previous part about backup site running CMS Joomla 2.5, we considered creating a backup copy of the site manually. Now...

    • Backups have been created and now let's figure out how to get and automate them this process. The easiest way to obtain a backup copy is to download it from a link or links, if the file is divided into several archives, in...




Top