First you need to download: mysql-connector-odbc-3.51.25-0.i386.rpm this is the client tool for connecting to mysql mysql-5.0.45.tar.gz Mysql database. Download as follows:
- Wget http://tlbb-server-make.googlecode.com/files/mysql-5.0.45.tar.gz
- Wget http://tlbb-server-make.googlecode.com/files/mysql-connector-odbc-3.51.25-0.i386.rpm
Copy code
1. Extract
- Tar xzvf mysql-5.0.45.tar.gz
Copy code
2. Go to the working directory
- Cd mysql
Copy code
3. Compile the configuration file generation
- ./Configure -- prefix =/usr/local/mysql5.0.45 -- with-charset = utf8 -- with-extra-charsets = all -- enable-thread-safe-client
Copy code
In this step, hardware detection, correlation detection, dependency software detection, and compilation of the required Runtime library function libraries are performed. Only after successful compilation can we compile correctly. -- Prefix to set the installation directory -- with-charset = utf8 to set the encoding -- with-extra-charsets to set the extended encoding support -- enable-thread-safe-client to enable secure thread 4. Compile (we recommend that you compile make clean after success, clear the intermediate files generated by compilation)
- Make
Copy code
5. Installation
- Make install
Copy code
6. Set File Modification
- Cp/usr/local/mysql5.0.45/share/mysql/my-small.cnf/etc/my. cnf
Copy code
This is the setting file. In the [mysqld] and [client] sections, add the following command default-character-set = utf8 to unify the encoding and display the correct information. In navicat, do this if you want to display Chinese characters and connect to the remote terminal normally. 7. initialize the database account and authorization table
- /Usr/local/mysql5.0.45/bin/mysql_install_db
Copy code
8. Start
- /Usr/local/mysql5.0.45/bin/mysqld_safe -- user = root &
Copy code
If you want to automatically start the system every time you restart the system, run the following command:
- Echo "/usr/local/mysql5.0.45/bin/mysqld_safe -- user = root &">/etc/rc. local
Copy code
To disable the function, run the following command:
- Mysqladmin-uroot-p password shutdown
Copy code
Install the mysql-connector-odbc-3.51.25-0.i386.rpm
- Rpm-ivh mysql-connector-odbc-3.51.25-0.i386.rpm
Copy code
9. log on to the mysql database with an empty password.
- Mysql-u root-p
Copy code
10. Change the password
- Use mysql; update user set Password = PASSWORD ('donglei') where User = 'root ';
Copy code
11,
- Grant all privileges on *. * TO root @ "192.168.1. %" identified by "donglei ";
Copy code
Authorize root. (On 192.168.1.% The logged-on root has all permissions on the database.) the mysql database authentication mechanism first checks the connected IP address, account, password, database, and data table for verification. If you want to allow the root user to log on to the Internet or the specified IP address, you must authorize the root user. For example
- Grant all privileges on *. * to root @ "ip address" identified by "password ";
Copy code
In fact, based on security management, it is not recommended to authorize the root account as the management account with the highest permissions to the Internet IP address. Only authorized to the local IP address. Otherwise it would be very dangerous.
For tianlong Babu server, you need to connect to the database to create a proprietary account: tlbb (of course, it can be other, but you are in Sharememory. in ini, LoginInfo. you can change the consistency in ini) First: 1. Create a tianlong Babu database:
- Create database tlbbdb;
Copy code
2. Create a user: There are many tables in tlbbdb, right? We need the tlbb user to read, modify, and delete the table content. So we can.
- Grant all privileges on tlbbdb. * to tlbb @ "ip address" identified by "password ";
Copy code
In this way, tlbb can have all permissions on all tables in tlbbdb (tlbbdb. * represents all tables in the tlbdb database.
- Flush privileges;
Copy code
In this two steps. That's simple. In this tutorial, there are only one more steps. Try it. 3. Finally, you can create an account, which can only query what cannot be modified. That's it.
- Grant select on tlbbdb. * to hwhw @ "ip address" identified by "password ";
Copy code
... For more commands, see mysql syntax. You will find out when you try again. Just a few words. It does not take that much trouble.
Finally, the data table is imported:
- Source Data source Path
Copy code
Then exit, OK.