====== Using phpMyAdmin ====== Greetings mortal! \\ \\ Below you'll find a (small) manual which will explain a few things about the use of phpmyadmin. \\ This manual has been made by using the following version: * phpMyAdmin - 2.11.8.1deb5 * MySQL client version: 5.0.51a {{ http://img25.imageshack.us/img25/3766/phpmyadminm.jpg?180x135}} As time will tell this manual might grow into something more larger. As for now this manual will only concentrate on the use of phpMyAdmin, not the installation for it! \\ \\ Before we can begin we will have to browse to the machine ([[http://IP/phpmyadmin/]] also look at the picture to the right) and login to be able to use anything phpmyadmin has to offer. We will use the root user mostly for the creation of new users. For the creation of databases we will use the user with the correct rights. ===== 1. Users ===== ==== 1.1. Create ==== {{ http://img25.imageshack.us/img25/821/pmausers01.jpg?185x130}} First, we'll have to login as root. Browse towards your phpmyadmin webpage (usually done by going to [[http:///phpmyadmin]]. \\ Login as root here, giving the username and password. \\ Next we are going to the page that is called "privileges" (right screen). \\ This screen will show what users are already present on the system with several key information pieces which could be usefull at some time. \\ \\ Since we are just adding users we can click on "Add a new User" ([[http://img18.imageshack.us/img18/2638/pmausers02.jpg|screenshot]]) and enter the next screen again. \\ \\ \\ \\ Once on this page we will have to fill in several fields: (right screen). {{ http://img9.imageshack.us/img9/2452/pmausers03.jpg?185x130}} * **Username**: The username used for database access. * **Host**: Since we are most likely only going to use this user on the same machine as the stats and mysql is hosted, lets just use '//localhost//' as **only** login possibility. If you are planning on seperating the mysql server with the server that holds the website files, set this to '//any//', * **Password**: I usually tend to use the 'Generate' button to generate myself a password. You can then use the 'Copy' button to copy over the generated password to the password fields. * **Important:** Store this password somewhere, you'll need it later! * **OPTIONAL:** You can already set database rights for the user. I myself like to use the "//Grant all privileges on wilcard name (username\_%)//" option. You can later login as this user and then create databases which will use the name '//username_database//'. You can also just select the option '//Create database with same name an grant all privileges//', which will create a database with the name name as the user. Only downside to this is that you have just one database to use with that user. After hitting '//Go//' you will see a screen that looks like [[http://img9.imageshack.us/img9/4681/pmausers04.jpg|this]] telling you the user has been created. \\ Congrats! You can now use this user! ===== 2. Databases ===== This chapter will explain certain options you can do with a database. \\ In the example screenshots we will always use the username '//1username//' with password '//0123456789x//'. ==== 2.1. Create ==== There are 2 ways of creating a database: \\ \\ **//1. With root//** \\ Normally a user won't have any rights to create any database itself. In which case you will have to ask someone with root access to create you a database. \\ This can also be done yourself, in which case you will have to create the database, edit the privileges of the user and add the user to the newly created database with rights. \\ \\ **//2. With a user itself//** \\ If the person who gave you an account (or you have made it yourself) and that user has been created with the option '//”Grant all privileges on wilcard name (username\_%)” //', this user will be able to create it's own databases. \\ \\ I will explain the second possibility, with the user itself, below. \\ \\ {{http://img4.imageshack.us/img4/7237/pmadbcreate01.jpg?180x135 }} {{ http://img16.imageshack.us/img16/4499/pmadbcreate02.jpg?180x135}} First, again, lets go to the phpmyadmin page via a browser. Use your login and password and hit enter (I'm using the login: //1username// for the purpose of this manual). \\ \\ Next in line would be the creation of a database. The browser will already show you the text '//1username_...//' inside the database creation text box. Lets create a database with the suffix '//hlx//'. To do this change the text that is already present in the box to '//1username_hlx//' and press '//Create//' (left screen). A new screen will open showing you that the database has been created succesfully (right screen). \\ \\ \\ \\ Congrats, you have now created a database with the user '//1username//'! \\ \\ ==== 2.2. Adjust ==== N/A for now, will be filled later. ==== 2.3. Import ==== PhpMyAdmin gives you the possiblity to import sql files into already excisting databases. Again, in order to do this you should login as the user with the correct database privileges (for this manual that would '//1username//' again). The left side of the phpmyadmin screen in the browser shows all the current databases the user has access to. Next to that it also shows the amount of tables the database is setup with. In the example screenshot to the right you will be able to see several databases for the user with 0 tables. \\ \\ {{http://img23.imageshack.us/img23/6573/pmadbimport01.jpg?180x135 }} {{ http://img21.imageshack.us/img21/8184/pmadbimport02.jpg?180x135}} There are several ways of accessing a databse. In this manual I will just use a simple example and go from there. We will be using the database called '//1username_hlx//' as an example.\\ First it is important to select the database you want to update. This can be done by simply using your mouse to hover over the name, in phpmyadmin, on the left side of the screen and clicking on the database name (screen left). \\ \\ This will open a new screen, with the current database selected on the left side. On the right, click on the tab that is called '//Import//'. This will show you a screen with several import options (screen right). Click the browse button (or w/e it might be called in your language) and select the .sql file you wish to import into the current database. After selecting the file and pressing '//Go//' you will get a screen with all the sql commands it executed. \\ \\ Congrats! You have just imported a sql file into the database '//1username_hlx//'. ===== 3. Other... ===== This chapter is just a placeholder and will be expanded / replaced over time. ====== Used pictures ====== Used Pictures: \\ Create user: [[http://img25.imageshack.us/img25/821/pmausers01.jpg|1 ]] [[http://img18.imageshack.us/img18/2638/pmausers02.jpg|2 ]] [[http://img9.imageshack.us/img9/2452/pmausers03.jpg|3 ]] [[http://img9.imageshack.us/img9/4681/pmausers04.jpg|4 ]] \\ Create database: [[http://img4.imageshack.us/img4/7237/pmadbcreate01.jpg|5 ]] [[http://img16.imageshack.us/img16/4499/pmadbcreate02.jpg|6 ]] \\ Import database: [[http://img23.imageshack.us/img23/6573/pmadbimport01.jpg|7 ]] [[http://img21.imageshack.us/img21/8184/pmadbimport02.jpg|8 ]] \\