Home / Archive by category MySQL Archive by category MySQL
This is a quick MySQL snippet that allows me to add user privileges to a MySQL database. The script will create a user first, then it will grant various privileges to that user. CREATE USER 'sqluser'@'%' IDENTIFIED BY 'sqlpassword'; GRANT USAGE ON *.* TO 'sqluser'@'%' IDENTIFIED BY 'sqlpassword' WITH MAX_QUERIES_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 […]
Read More
If you have recently upgraded your MySQL version to 5.6, your mysqldump command will probably throw the following error: mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 […]
Read More
Newrelic?is an application monitoring tool that truly is developer’s best friend. It’s such a true statement. ?I’ve used Newrelic to pinpoint and successfully troubleshoot numerous applications. ?I’ve recently switched all database tables from MyISAM to InnoDB for a couple of reasons that are outside the scope of this post. What came to my intention is […]
Read More
I’ve wanted to write a few stored procedures in MySQL for a while now, but I found it very fiddly and was unable to come up with one very quickly. Tonight I was determined to read up on MySQL documentation and get one going. For my reference only, this stored procedure will loop through a […]
Read More
I just wrote a little mysql snippet that will replace all instances of ‘domain1’ to ‘domain2’ in a given table and column. So why not share it. ?All you need to do is set the variable values in first 4 lines of code below: SET @tblname = "tablename"; SET @colname = "columnname"; SET @lookfor = […]
Read More
I’ve had problems starting up MySQL database server on startup on Snow Leopard. ?MySQL preference pane seems to be flaky and it often fails to start MySQL server. I created this startup script myself and it seems to work nicely. sudo nano /System/Library/LaunchDaemons/org.mysql.mysqld.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> […]
Read More
Following my post on Snow Leopard Gotchas, I discovered another problem you might run into. SL comes with currently the latest version of PHP 5.3.0. However, not all PHP projects will play nice on v5.3.0. What you could do is: 1. build and configure an older version of PHP from source – e.g. 5.2.11 2. […]
Read More
I recently upgraded to Snow Leopard from 10.5 and everything went relatively smoothly. I was particularly pleased to see extra 13GB of hard drive space. However, I noticed a couple of things that I wasn’t so pleased about: Apache unable to start PHP disabled MySQL unable to start I’ve already walked a couple of people […]
Read More