Downloading MySQL
The MySQLi augmentation is intended to work with MySQL variant 4.1.13 or fresher, So need to download MySQL. All downloads for MySQL are situated at MySQL Downloads. Pick the most recent rendition number for MySQL Community Server you need and, as precisely as could be expected, the stage you need.
Installing MySQL on Linux/UNIX
The prescribed method to introduce MySQL on a Linux framework is through RPM. MySQL AB makes the accompanying RPMs accessible for download on its site −
- MySQL − The MySQL information base worker, which oversees data sets and tables, controls client access, and cycles SQL inquiries.
- MySQL-customer − MySQL customer programs, which make it conceivable to associate with and communicate with the worker.
- MySQL-devel − Libraries and header records that prove to be useful when accumulating different projects that utilization MySQL.
- MySQL-shared − Shared libraries for the MySQL customer.
- MySQL-seat − Benchmark and execution testing devices for the MySQL information base worker.
The MySQL RPMs recorded here are completely based on a SuSE Linux framework, however they'll normally chip away at other Linux variations with no trouble.
Presently, follow the accompanying strides to continue for establishment −
- Login to the framework utilizing root client.
- Change to the registry containing the RPMs −
- Introduce the MySQL information base worker by executing the accompanying order. Make sure to supplant the filename in italics with the document name of your RPM.
[root@host]# rpm -i MySQL-5.0.9-0.i386.rpm
Above order deals with introducing MySQL worker, making a client of MySQL, making essential setup and beginning MySQL worker naturally.
You can locate all the MySQL related parallels in/usr/canister and/usr/sbin. All the tables and information bases will be made in/var/lib/mysql index.
- This is discretionary however prescribed advance to introduce the leftover RPMs in a similar way −
[root@host]# rpm -i MySQL-client-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-devel-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-shared-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-bench-5.0.9-0.i386.rpm
Installing MySQL on Windows
Default establishment on any rendition of Windows is presently a lot simpler than it used to be, as MySQL currently comes flawlessly bundled with an installer. Essentially download the installer bundle, unfasten it anyplace, and run setup.exe.
Default installer setup.exe will walk you through the minor cycle and of course will introduce everything under C:\mysql.
Test the worker by terminating it up from the order brief the first run through. Go to the area of the mysqld worker which is likely C:\mysql\bin, and type −
mysqld.exe --console
NOTE − If you are on NT, at that point you should utilize mysqld-nt.exe rather than mysqld.exe
In the event that all worked out positively, you will see a few messages about startup and InnoDB. If not, you may have a consents issue. Ensure that the index that holds your information is available to whatever client (most likely mysql) the data set cycles run under.
MySQL won't add itself to the beginning menu, and there is no especially decent GUI approach to stop the worker by the same token. Accordingly, on the off chance that you will in general beginning the worker by double tapping the mysqld executable, you ought to make sure to stop the cycle by hand by utilizing mysqladmin, Task List, Task Manager, or different Windows-explicit methods.
Verifying MySQL Installation
After MySQL has been effectively introduced, the base tables have been instated, and the worker has been begun, you can check that everything is functioning as it ought to through some straightforward tests.
Use the mysqladmin Utility to Obtain Server Statu
Use mysqladmin double to check worker adaptation. This paired would be accessible in/usr/receptacle on linux and in C:\mysql\bin on windows.
[root@host]# mysqladmin --version
It will create the accompanying outcome on Linux. It might shift contingent upon your establishment −
mysqladmin Ver 8.23 Distrib 5.0.9-0, for redhat-linux-gnu on i386
In the event that you don't get such message, at that point there might be some issue in your establishment and you would require some assistance to fix it.
Execute simple SQL commands using MySQL Client
You can associate with your MySQL worker by utilizing MySQL customer utilizing mysql order. Right now, you don't have to give any secret word as naturally it will be set to clear.
So utilize following order
[root@host]# mysql
It ought to be remunerated with a mysql> brief. Presently, you are associated with the MySQL worker and you can execute all the SQL order at mysql> speedy as follows −
mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.13 sec)
Post-installation Steps
MySQL ships with a clear secret phrase for the root MySQL client. When you have effectively introduced the data set and customer, you need to set a root secret phrase as follows −
[root@host]# mysqladmin -u root password "new_password";
Presently to make an association with your MySQL worker, you would need to utilize the accompanying order −
[root@host]# mysql -u root -p
Enter password:*******
UNIX clients will likewise need to place your MySQL catalog in your PATH, so you won't need to continue to compose the full way every time you need to utilize the order line customer. For slam, it would be something like −
export PATH = $PATH:/usr/bin:/usr/sbin
Running MySQL at boot time
In the event that you need to run MySQL worker at boot time, at that point ensure you have following section in/and so on/rc.local document.
/etc/init.d/mysqld start
Also,you ought to have mysqld twofold in/and so on/init.d/index.