To restart, start or stop MySQL server from the command line, type the following at the shell prompt… On Linux start/stop/restart from the command line: /etc/init.d/mysqld start /etc/init.d/mysqld stop /etc/init.d/mysqld restart Some Linux flavors offer the service command too service mysqld start service mysqld stop service mysqld restart or service mysql start service mysql stop …
Read More
Change and Update WordPress URLS in Database When Site is Moved to new Host
After migrating a WordPress site to a new URL either live or to a production or development server, the new URL strings in the mysql database need to be changed and updated in the various mysql database tables. To avoid working directly in the database you can also to this in a gui style interface with …
Read More
How to Change the MySQL root Password in Linux or macOS via Command Line
If you have forgot the MySQL root password, can’t remember or want to break in….. you can reset the mysql database password from the command line in either Linux or macOS Sierra and OSX as long as you know the root user password of the box you are on, this is for MySQL 5.7 onwards: Stop …
Read More
Remove MySQL instance from macOS or OSX via the command line
To remove an instance of MySQL from your macOS or OSX installation you need to delete a number of files via the command line, but first ensure that you have database dumps of your databases and that then the database server is not running. Back Up any needed databases All of them mysqldump –all-databases > …
Read More
How to connect to a MySQL database with PHP
This tutorial will require a mysql database and a web development environment using mysql, apache and php and a simple text editor. The tutorial takes you through establishing a mysql connection using php on a web page, connecting to a mysql table and retrieving the results and displaying them back on the web page. This tutorial …
Read More
Import / Export a mysql database on the command line
To export a mysql database (as a dump) from the command line run: mysqldump database_name > database_exportname.sql To import a mysql database dump into a database: mysql database_name < database_exportname.sql To export all databases into a dump: mysqldump –all-databases > all_databases_export.sql To import one of these mysql databases from the dump into a database: mysql –one-database database_name < all_databases_export.sql
Find out how many database queries per pageload in WordPress
To find out how many WordPress mysql database queries a page requests and how long it takes the page to load whilst querying the database, you can add in a PHP function to a WordPress hook to find out. This can be displayed in either the source code of the html or rendered on the …
Read More
Installing phpMyAdmin on Mac OSX 10.9 Mavericks & 10.8, 10.7, 10.6
To interact with MySQL by instead of using the command line, phpMyAdmin comes to the rescue, to get it running as part of your local development set up on OS X, a couple of steps need to be done. phpMyAdmin is a browser application that interacts with the underlying mysql data. These steps will work on …
Read More