Setting up phpMyAdmin and MySQL on local hosting Denver. Management. Installing phpMyAdmin

GNU General Public License V2.0.

You can get the latest version in the "Download" section or at the office. website www.phpmyadmin.net

Available file formats: .zip, .tar.gz and .tar.bz2.

If you have already installed phpMyAdmin, it is recommended to subscribe to the newsletter: or Russian language (website). Thus, you will always be informed about updates, vulnerabilities and their fixes. The newsletter is exclusively text-based, without graphic elements, so traffic consumption is minimal.

User support

The documentation is included in the distribution in the form of a text file, as well as a file in HTML format; in addition, you can read the documentation in the "Documentation" section (translation of the original documentation into Russian) or at the office. website www.phpmyadmin.net (English original version).

This software is provided without any specific or implied warranty, but it is possible to send a message to the developers about a bug found so that it can be fixed.

In addition, there is a page dedicated to phpMyAdmin on SourceForge.net.

And finally, user support is provided on .

Participation in the development of the project

In order to be aware of the bugs found and how to fix them, you can subscribe to, or regularly check the bug tracker on.

If you find a bug, you can take part in the development of the project as much as you can by sending a notification using our bug tracker, which is located at http://sourceforge.net/projects/phpmyadmin/ in the Bugs section. But first, please discuss the discovered bug with other users in English - perhaps it is already known and fixed.

If you want to take part in updating the Russian language file, go here: . Try to always use the current SVN version of the language file. To translate into a new language, start with english-iso-8859-1.inc.php. If you don't know how to get the SVN version, ask any of the developers - they will tell you.

Remember that we try not to use HTML entities like that? in translations, we determine the correct character set in the file. When using HTML entities, text in JavaScript messages may not display correctly. However, there are some objects that are problematic to do without: quotes, ampersand, less than, greater than. It is then recommended to archive the translation as a zip file to prevent the loss of special characters when passing it to the translation tracker on sourceforge.net.

PhpMyAdmin is open source software, many useful functions were written by phpmyadmin-team members from different countries. If you are a web developer and would like to help make phpMyAdmin a more convenient and efficient tool - welcome!

Before taking part in the development of the project, please read the following information: Developed, improved or corrected modules are published as follows.

Each new installation of CMS Joomla requires the creation of a new database. This database will store data such as articles/materials, menus, categories and users. This data is necessary to manage the site on Joomla!

To install Joomla, you must have a working database, a database user, a database user password, and appropriate database user privileges.

This material will look at the most common type of database used when installing Joomla, namely the MySQL database. We will look at two options for creating a database for Joomla. The first method will be to create a database on a local server, and the second will be to create a database on hosting, with an emphasis on using DirectAdmin - the hosting control panel. But other hosting control panels should have similar database creation steps.

Creating a MySQL database on a local server

In order to create a database on a local server, you must first install it. Therefore, we download the local server – Denwer [Download] and install it. Denwer installation instructions .

After successfully installing the local server, you can begin creating a database for installing Joomla! In order to get to the database management interface, you need to start the local Denwer server (if not running) and enter in the browser address bar: http://localhost/tools/phpmyadmin. In the window that opens, you will see the “phpMyAdmin” web interface. Now you can proceed directly to creating the database.

The database and the user for it have been created, now you can begin installing Joomla on the local server.

Creating a MySQL database on hosting

As mentioned above, creating a database on hosting will be carried out using the example of the DirectAdmin control panel. But all stages of creation will be similar to any hosting control panel.

To create a database on your hosting, you need to log into your hosting control panel. You should know how to log into your hosting control panel yourself; when you registered your hosting, you should have been sent all the information on how to use it. Otherwise, you can clarify any information by contacting the technical support of your hosting provider.

Once you have logged into your hosting control panel, you can proceed directly to creating a database.


Now you can install Joomla 2.5(or install Joomla 3.1) directly on the hosting and at a certain stage of the installation you will have to enter the data that needed to be recorded (database name, username, user password and host).

And also installed it on your computer. As you know, Apache web server allows you to host multiple websites on one computer. In turn, MySQL allows you to serve many databases. Typically, webmasters create a separate database for each site; each database contains tables with data from a specific site.

In addition, MySQL has the ability to create additional users. After installing MySQL, you have the root user at your disposal, which has the highest rights. Using it directly to access a database from, say, PHP is very unsafe. The most optimal and correct solution is to create for each database its own user, who has access only to this database. With this scheme, if one of the sites on your server is hacked, the data in the databases of other sites will remain inaccessible.

Let's look at the process of creating a database using phpMyAdmin. Let's say we want to install a forum on the site, we need to create a separate database for it. To do this, go to phpMyAdmin as the root user (how to install phpMyAdmin is described in this lesson) and go to the “Privileges” section:

Click "Add new user":

The add user form will open:

Let's enter a user name that is related in meaning to the purpose of the database being created. As an example, we are creating a database for a forum, so we call the user forum. If MySQL and the web server are located on the same computer, then select Host: local to improve security. You can enter the password yourself or generate it. Be sure to remember your password! Check the box next to "Create a database with the username in the title and grant full privileges to it." Click "Create User".

Exit phpMyAdmin and log in again using the username and password of the created user. Only the database matching the username should be available in the list of databases (in addition to the system database information_schema):

Let's try using PHP to connect to the created database:

"<пароль_пользователя_forum>" ) ; if (! $link ) ( die ("Unable to connect: " . mysql_error());

) echo

"Successfully connected" ; mysql_close($link);

?>

With this simple sequence of actions you can create a user and a database for any engine that works with MySQL.

Hello, dear readers of the blog site. Today I want to talk about a script (program)

PhpMyAdmin

In general, in this video course, Evgeniy talks about writing his own CMS (not as complex and sophisticated, of course, as, for example, but still having an admin panel) using PHP and the MySQL query language. Along the way, you naturally learn the basics of these languages, which will come in handy and will be useful when working with your own website. The course is very large and voluminous, but, in my opinion, useful, especially for beginners in this matter.

PhpMyAdmin will be installed on the vast majority of hosting sites (at least on the RuNet) to provide webmasters with the ability to work with their databases. Databases are created, as a rule, using the hosting control panel itself (), but working with an already created MySQL database for almost all hosters is left to PhpMyAdmin, and this is correct, because it is very well suited for this, and the script itself is familiar to many .

That. You most likely won’t need to install and configure this program itself, but I will still, just in case, briefly tell you where you can download the script and how to install and configure it. By the way, this program can be used not only on the hosting server, but also on a local server with MySQL installed. The script is already included by default.

In general, it’s hard for me to imagine a situation where you might need to install and configure PhpMyAdmin yourself, although I’ve encountered such a situation. A year and a half ago, the blog site was hosted by, where at first this script was not installed and I had to download and install it myself, although there is nothing complicated about it.

Download PhpMyAdmin with support for the Russian language, you can from this page, although you can also download a version of the script with support for only the English language from there. The latest current version is 4.0.5 and it will be compatible with PHP 5 and MySQL 5.

Version 2.11.11.3 is compatible with older versions of PHP 4+ and MySQL 3+. After downloading the program archive, you will need to unpack it and connect to your site via FTP, for example, using .

Create a directory in the root folder (usually either PUBLIC_HTML or HTDOCS) of your site with any name you understand, for example, “myadmin” (if you use capital letters in the name of the directory, then when accessing it from the address bar of the browser you will have to take into account character case).

Well, now, using FileZilla, copy the contents of the archive with the script into the created directory (the whole bunch of folders and files from the distribution can be selected at once by pressing Ctrl+A on the keyboard) and click on the “Upload to server” item, selecting it from the context menu:

Once the files are copied (this is install PhpMyAdmin) you need to pre-configure this script. The easiest way to set this up is to rename the file "config.sample.inc.php" (from the "myadmin" folder you created) to "config.inc.php".

After this, open the resulting file “config.inc.php” for editing and proceed with the settings, which consist of setting an identifier that helps encrypt your password for accessing PhpMyAdmin in the browser cookie. To do this, in the line:

$cfg["blowfish_secret"] = "";

Enter at least 10 characters between single quotes, like this:

$cfg["blowfish_secret"] = "sjkdflscokdkld";

You do not need to remember the entered sequence. Actually, the preliminary setup of PhpMyAdmin can be considered complete. Although, you can also change the default login method, which is specified in the line:

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

In this case, you will have to enter your username and password each time to log in, which can be stored in a cookie using the browser. But you can replace this line with this code:

$cfg["Servers"][$i]["auth_type"] = "config"; $cfg["Servers"][$i]["user"] = "your_logint"; $cfg["Servers"][$i]["password"] = "parol_odnako";";

In the second and third lines of this code, you set the login and password to enter the program, which now you will not need to type (automatic login). But this login method is less secure than the default one, although if you are working with the site on local host, then this login setup will be preferable.

Export and import database via PhpMyAdmin

After you finish setting up, you can try to log in. To do this, you need to type in the address bar of your browser the path to the folder where you installed the PhpMyAdmin distribution files. That is, for example, for my blog this address would look like this:

Https://site/myadmin/index.php

If you installed and configured the script correctly, a window will appear prompting you to enter your username and password to enter the program:

To login, you can use the username and password that your host gave you. If you install PhpMyAdmin on your server, the login will be “root” by default, and the password is the one you specified when installing MySQL. As a result, you will be taken to the main page of the script:

The house icon will always allow you to return to the initial page of the program. Let's look at the actions that users most often perform - creating and restoring a database backup. In general, of course, you can create a database backup in many ways, but backups made through Php My Admin have never failed me.

There are scripts and extensions for various CMSs that can create database backups on a schedule and without your participation at all, but I personally prefer to use manual backups (I feel safer that way). The database of various CMS contains the most valuable thing that you have on your site - the articles you wrote, the loss of which would be irreplaceable.

In the left column of the PhpMyAdmin interface, select the database you want to backup, then go to the “Export” tab from the top horizontal menu of the main program window:

This program can archive a backup copy of the database on the fly, so at the very bottom of the page that opens it makes sense to check the “gzip” box, thereby reducing the volume and time of downloading. In the “Export” column, by default, all tables from the database you need will be selected and the format for saving it as “SQL” will be selected.

If you want to copy only some tables, then select only them. To create a backup in PhpMyAdmin, you just need to click on the “ok” button and select a location on your computer to store the archive. Actually, everything is quick and simple. The only thing you need to do is remember to repeat this procedure after adding new materials to the site.

Now let's think back to that sad moment when you may need restore database from a previously created backup. First, it is better to delete all existing tables in the database being restored. To do this, click on its name in the left column of the program and, under the list of all database tables, click on “Mark all” and select “Delete” from the drop-down list:

After that, you go from the top menu of the main PhpMyAdmin window to the “Import” tab, click on the “Select file” button and start scouring your computer in search of the latest up-to-date backup copy of the database you need.

The program will take some time to extract and restore all database tables from the archive, after which you can again enjoy a fully functional website. Everything is also very simple and fast, which is good news.

Creating a new database and user in PhpMyAdmin

If you are creating a website on your own server (local, virtual or dedicated), then you may need create a new database, which can be easily done in this program. To do this, on the initial page you will only need to enter its name in the “Create a new database” field and click the create button. That's it, a new database has been created in PhpMyAdmin.

Now we will need to create a user for this database - on the initial page, follow the “Privileges” link:

And in the window that opens you need to follow the link "Add new user":

  1. Username - enter the desired name in Latin (it will be your login when logging in)
  2. Host - usually enter localhost
  3. Password and Confirmation - come up with a more complex password so that the enemy does not guess

In the “Global Privileges” area, select the capabilities that will be provided to the user you create. For a local server, it would be best to click on the “Mark all” link:

Well, we also successfully created a new user in PhpMyAdmin.

Other ways to use PhpMyAdmin

I once had a case when, after moving my site to another server, it began to generate a database error. Having opened the program, I saw a message that one of the tables in my database was damaged.

But this problem was solved quite simply and quickly using PhpMyAdmin itself. To do this, I checked the damaged table and selected the “Restore table” option from the drop-down list below.

In addition, quite often I use the option on table optimization who need this optimization. To do this, just click at the very bottom of the list of tables on the “Mark those requiring optimization” link and select the “Optimize table” option from the drop-down list:

Well, I also sometimes use this opportunity to run SQL queries on certain database tables. It is very convenient when you need change something in the texts of all articles on your website. If the number of articles has exceeded a hundred, then doing this manually is simply not possible. The same can be done by installing the necessary extension on your CMS, but you can get by with PhpMyAdmin alone.

Attention!!! Before you perform the following steps , be sure to make a backup database in the manner described above.

In WordPress, articles are stored in a table called “wp_posts”, so to make changes to the texts of all articles you need to click on the name of this table in the left column of the program window, and in the central window go to the “Browse” tab from the top menu:

A separate window will open in which you will need to type SQL query text, making changes to all articles on the site. This text will look something like this:

UPDATE wp_posts SET post_content =REPLACE(post_content, "what_needs_change", "what_needs_change");

The last time I changed the heading levels inside articles (I removed h4 level headings, replacing them with h3) and sequentially executed the following SQL queries through PhpMyAdmin:

UPDATE wp_posts SET post_content =REPLACE(post_content, "

", "

"); UPDATE wp_posts SET post_content =REPLACE(post_content, "

", ""););

To the right of the SQL query input area in the PhpMyAdmin window, you can select only those fields in which you want to make changes. Article texts in WordPress are written in the “post_content” field:

There are many more ways to use this program to perform day-to-day database operations.

If you know any other useful features of PhpMyAdmin, then post a link in the comments, or explain the essence of the matter in words.

Good luck to you! See you soon on the pages of the blog site

You can watch more videos by going to
");">

You might be interested

Windows clipboard and saving its history in Clipdiary
Dropbox - how to use cloud data storage, as well as working with the Dropbox program on a computer and mobile Programs for promotion on Instagram
KeePass is a complex password manager and generator, as well as the best program for storing and conveniently using passwords
Notepad++ - free Html and PHP editor with syntax highlighting, overview of features and the best plugins for Notepad++

– This is a script that is written in PHP and provides the ability to manage MySQL databases. Allows you to run SQL query commands, work with database fields and tables (create, edit, delete, etc.). In PhPMyAdmin you can create new databases, do much more. PhpMyAdmin is installed on almost every hosting and is included in the standard configuration of the local Denver server.

In most cases, when working with Joomla, PhрMyAdmin is used only for creating new databases (most often this is done in Denver) and for copying and restoring (Import/Export). The remaining features of PhрMyAdmin are used by advanced Webmasters and developers.

In this article I want to talk about situations in which you can use PhpMyAdmin.

Creation of a database (mostly in Denver).

To do this, type this path in the address bar of your browser:

http://localhost/tools/phpmyadmin

Following this link will launch phpMyAdmin. (Denver must be installed and running).

In order to create a database, you need to enter the name of the future database in the New database field and click the create button, it is worth noting that the database encoding for Joomla must be in UTF-8 (as in the figure below).

If you also need to create a user for the new database, then you need to click on the privileges button and on the page that opens click the link " Add a new user"(The user has certain privileges that are established when he is created, due to these privileges he can change, delete, create new tables and fields in the database). If phrMyAdmin is on the hosting, then login/authorization occurs using the specified username and password) .

Next, you need to fill in the required fields and click the ok button at the bottom of the screen; an example of filling out the fields and actions is shown in the figure below. If everything was done correctly, you will see a message that a new user has been added.

Note. Creating a user is possible only in Denver; on regular hosting, as a rule, the user has already been created and has all the necessary privileges (username and password are sent to your email), or a new user is created through a separate interface of the hosting provider (with all the necessary privileges), where You enter the username and password yourself and then they are used for authorization in phpMyAdmin (just don’t forget to write it down somewhere).

Creating a database backup using phpMyAdmin

To create a database backup, go to the phpMyAdmin main page and in the left window, select the desired database (for which you need to make a backup) by clicking on it.

In the image below, a database named auto (45), in brackets indicates the number of tables that are in the database.

After you select the database, a new window will open with its contents. Next, you need to click on the “ Export" at the top of the window (as shown in the image below).

The “Export” button means copying the database into a text file and saving it on your computer. By clicking this button, a new window will open with export settings settings, all you need to do here is select all the database tables, check the box " Save as file" and press the button ok in some versions of phpMyAdmin this button is called went.

Please note that when exporting a database, you can specify various settings, for example, pack the database into an archive; this is mainly used when the size of the database is very large and takes up tens or even hundreds of megabytes, since exporting such a heavy database is not possible on some servers It will work out due to hosting limitations. To solve this problem, you need to set the format in which the database will be packaged during export and click the ok button.

Restoring a database from a backup using phpMyAdmin

To restore from a database backup, you need to perform the following sequence of actions. First you need to clear the existing database of all tables. To do this, you need to log in to phpMyAdmin, select the required database in the left column that you are going to restore from a backup, and in the window that appears, you need to go to the very bottom of the page and click on the link “ Select all" and select the option " Delete» from the drop-down list.

This will open the following window with a list of all tables to confirm the deletion of tables. You need to click on “ Yes" After this, you can restore the database from a previously made backup copy.
To do this, go to the tab “ Import" and in the window that appears, click on the button " Review" and find the previously made copy of the database on your computer. Next, you need to make sure that the encoding is UTF-8. Then press the button " OK" and wait for the database backup to finish loading.

Other uses

Here are some more examples of using PhpMyAdmin: one day, while testing one component, the database somehow became corrupted, causing the site to stop working completely. During database corruption, if this happens, a message is displayed stating that the database is damaged or there is no connection. To solve this problem, you need to go to PhpMyAdmin, which also displays the corresponding message. Next, you need to check the damaged database table and select the option from the list - "Restore table", after which you will see the following message: The SQL query was executed successfully.

Optimizing tables in the database via phpMyAdmin

There is also a rather useful table optimization feature. This option deletes all already deleted data that is still stored in the tables, thus significantly clearing the table of garbage and reducing its size. To optimize tables, you need to check all the database tables and click on the link from the list "Optimize table". Just be sure to back up your database in case something goes wrong.

The next way to use PhpMyAdmin's capabilities is to run SQL queries against database tables. This moment is extremely convenient, especially when you need to change something of the same type in all the texts on your site at once. For example, if the number of articles on your site is more than 100, then doing this manually is quite time-consuming and labor-intensive. And here one request and everything is ready.

Just always remember and remember to always back up your data before making any changes. Articles in Joomla are contained in a table called " jos_content", therefore, to make changes to all texts, you need to click on the name of this table. In the window located in the center, go to the “Browse” tab.

On the page that appears, click on "Change". In the new window you need to enter the text of the SQL query, which will make changes to all articles. On the right in the PhpMyAdmin window, you can select only those fields in which you want to make changes.

From all of the above, it turns out that for a restful sleep you need to have up-to-date backups of your database and files on your local PC. These same backups can be used when you transfer your site to a new hosting.