Using the popular HC-SR204 gives an easy to understand and implement look at how the Arduino can interact with the world around it.Continue reading Arduino – Ultrasonic Rangefinder
Adding a Display to you project can add a tremendous amount of value and feature. This simple project shows the learner how to hook up the LCD using four wires and 2 for control.READ MORE
The sequence of LEDs is a circuit that is specifically designed to teach a For Loop in Arduino Code. Secondarily, this project reinforces the purpose of a single Digital Pin.Continue reading Arduino – Cylon
The button sketch uses a single button press to light an LED. The button sketch introduces the concept of Input and Conditional execution of code.Continue reading Arduino – Button
Working on manual backup of my WordPress site I developed a very simple approach to migrate the WordPress database user along with their password. This can be used on any or multiple users of the database.
- A MySQL server with the user you want to copy to the backup
- A working installation of MySQL Workbench
- Server Connection to Source ( web-server for the source )
- MySQL Server connection to target ( localhost in my case )
Getting the user with CREATE Statement
From the source database open a new query and enter the following SQL: Replace mcp_user with the user you would like to migrate.
show create user 'mcp_user'@'localhost';
First, using the MySQL Workbench connect to the source that has your user.
It should look something like this:
Run the query and then you can copy the results by right clicking on the Result Grid row and selecting “Copy Row (Unquoted)”. Connect to your local MySQL instance and paste the result into a new query.
Retrieve the Permissions
we will use the same command but for grants, again replacing “mcp_user” with your user.
show grants for 'mcp_user'@'localhost';
Perform the same copy action from above but this time select both rows before right clicking.
Copy User to Local Database
When you are finished you should have in your local host the following query, add a USE database; statement at the top, where database is the name of your schema.
USE mcp_wordpress; CREATE USER 'mcp_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*A4852D8F9BDEFAXXXDD35EED97BEXXXYYY4E5BA' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK; GRANT USAGE ON *.* TO 'mcp_user'@'localhost'; GRANT ALL PRIVILEGES ON
mcp_wordpress.* TO 'mcp_user'@'localhost'; GRANT ALL PRIVILEGES ON
mcp_wordpress.* TO 'mcp_user'@'localhost';
Test the User
Run this SQL and the attempt to login and do a show database to confirm.
mysql -u mcp_user -p
The password will be the same as the originating database
Only the one database should be listed in my case.
That’s it, seems like a lot but it only 7 or 8 lines of SQL. If you know how to execute the results of the SHOW GRANTS or the SHOW CREATE, statements or an easier method, leave a comment I would love to learn that without a lot of digging around.
Everyone’s First Arduino Project
The epinomous Blink example. This diagram can be used along side of your lessons to teach students the first and most basic of the Arduino sketchesContinue reading Arduino – Blink