Advice 1: How to connect database to a website

To the website, actively worked and saved all user data or just kept the material, you need to connect the special database. Not everyone copes with the task, since it has no idea about it. However, everything can be solved in a matter of minutes.
How to connect database to a website
You will need
  • - personal computer;
  • - Internet;
  • website
Instruction
1
Create the very base of data that you connect to the website. Go to "control Panel" which is located on the site. Select "Database". Create a new document. After this operation, the obtained database will look as follows: account_Название database. You must also create a user name. Now to the resulting database connect script. Locate the file which defines the connection settings. It is usually called config.php.
2
Edit the configuration file. This can be done on a personal computer by going through "start" in the program "Notepad". Write down all the connection settings:
1)$hostName = "localhost"; // localhost is the hostname
2)$userName = "account_НазваниеПользователя"; // database user name
3)$password = "*****"; // the user's password
4)$databaseName = "account_НазваниеБазыДанных"; // name of the database.
Further, all data transfer for hosting.
3
You can make database connection in a different way. Go to "control Panel" on the right hosting. In the menu, locate and click on the section "Managing MySQL users". Then click the "Add" button. Thus you have created a username and password. Click "Next". Go to the "Manage MySQL databases". Click on the "Add" button. In the description enter the name "Admin". Again click on the "Add" button. Remember your database name and password. Click "Next". A window will open where you need to make some adjustments. Add the user name of the database. On the host, create the directory database. In the folder you created, make a record. This file will be called connect.php. It includes the connection settings. If necessary, fill in all the required items using user data.

Advice 2: How to create mysql database

MySQL is one of the most popular all over the world. It is used in both small and huge high-load projects. Therefore, experience with mysql will not be superfluous to any technician employed in the field of IT. To learn how to work with mysql by reading the documentation and practicing. But there will be many questions. And one of the first will be the question of how to create a mysql database data and by what means it is best to do.
How to create mysql database
You will need
  • Access data to mysql server. The console client program mysql.
Instruction
1
Connect to the mysql database server. To do this, run the mysql console client with the correct values of the parameters -h, -u and --password. The-h option specifies the host name of the mysql server. The-u option specifies the user name under which the mysql client to login on the server, and the parameter --password - password of the user. As the name of the server hostname can be specified IP address or symbolic name. The command line mysql client to connect to the database server running on the local machine with username test_user and password test_user_pwd, might look like this: "mysql -h localhost -u test_user --password=test_user_pwd". If the client program successfully connect with the server, the screen prompted.
How to create a mysql <strong>database</strong> data
2
Print a list of available character sets that can be used to create databases. Enter the command "SHOW CHARACTER SET;" and press ENTER.
How to create a mysql <strong>database</strong> data
3
Print a list of existing databases. Enter the command "SHOW DATABASES;" and press ENTER.
How to create a mysql <strong>database</strong> data
4
Select the name and the character set for the database that will be created. The name should not appear in the list of names already existing databases. The character set must be installed on the server. You can select it from the list shown by the command "SHOW CHARACTER SET;".
5
Create mysql database data. To do this, type the following command "CREATE DATABASE `database_name` CHARACTER SET COLLATE naborshikova previlant;". As the parameter database_name specify the name of the database. The parameter "naborshikova" must be a valid character set name. Setting previlant specify the field value of "Default collation" from the list of character sets corresponding to the selected set. If You are not sure which set of characters should be used for the database, select utf8. This is a universal kit that supports almost all existing characters of almost all languages of the world. Upon successful creation of the database corresponding message will be displayed.
How to create a mysql <strong>database</strong> data
Note
Be careful when deleting databases. Remote databases cannot be restored.
Useful advice
For General help on command-line options of the console client program mysql use "mysql --help". If you don't want to specify your password in the clear, replace the parameter --password the-p parameter without a value. In this case, the password will be requested. In order to create a database with predefined values of parameters CHARACTER SET and COLLATE, use the command "CREATE DATABASE `database_name`;". Mistakenly created a database you can delete with the command "DROP DATABASE `database_name`;".

Advice 3: How to create a simple database

A database is information, which is structured in a certain way. Such data is very easy to work, and the search process is considerably accelerated. And how to create a simple database data?
How to create a simple database
Instruction
1
Consider carefully the structure of the database. Define the information that will be contained and calculate the number of required columns, for example, for client mailing required email address. Please note that all information is easier to place in multiple tables, not one. The data then will be much easier to adjust, instead of looking at all the information.
2
Create database data in Microsoft Office Access. First, open the program and set the command "Create file". Then in this section select "New database data.
3
Name your database data a name that will be associated with posted data and save it in the correct folder. Automatically database can be stored in "My documents".
4
Select "Create table in design view" double click the mouse. This option is the most convenient, since it allows you to create a table with the standard number of columns and desired number.
5
Consider the window that appears to create the table. The first column "field Name", enter there the name of the corresponding attributes. In the next column "data Type" to be a dropdown list from which you select the appropriate type, for example, text, numeric, etc. the Third column called "Description". Put the necessary details and data.
6
Change the values. To save space on the disk, set the size of the fields, i.e. columns, desired value, for example, is not always required 50 standard symbols to record the name and it takes only 10-15 characters. Then the file save.
7
Change the table structure. Move the cursor to the dialog box, and select "Insert" - "Row". Thus, increase the number of fields for entering new data. Add a field in which place the primary key of the table. This key will identify each line, and an individual number, which is nowhere duplicated will not.
Is the advice useful?
Search