Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, April 14, 2014

Windows host file helps in speeding up MySQL localhost access

We had a problem before, where the PHP page does not load as fast as it should on mySQL database access.  We seem to have solved it by allowing the 127.0.0.1 to point to localhost.

What we did was removed the comment sign # to resolve the ip as localhost.

Host file is found at the following directory: c:\windows\system32\drivers\etc\
File name is hosts.

There are a lot of source material on the internet to edit the host file.

This is one of them:
http://helpdeskgeek.com/windows-7/windows-7-hosts-file/

Wednesday, December 4, 2013

PHP PDO why the error message given has the computer name, and domain

I have been trying to connect to mySQL server locally and there is an error give with Password:NO.

After searching for a while there is a simple explaination the username and password I have given does not have rights to the database I have specified, hence the error message.

The solution and explination can be found here: http://stackoverflow.com/questions/13002409/why-php-pdo-uses-a-different-from-hostname-to-the-one-used-by-mysql-connect-wh

Hope this helps. Happy coding.

Monday, December 2, 2013

500 Internal Server Error Message

At work I have seen one of our site going down/offline and looking at it on the IIS the website is on and looking at the log files, there was no error.

I think this website could be the answer on why it has been down: https://kb.mediatemple.net/questions/1903/Why+am+I+getting+a+500+Internal+Server+Error+message%3F

Which is understandable, since out database is located somewhere else.  It could have been timeout that causes our website to show 500 error.

Another thing that could help in determining is the Timeout detection as a sample on this website: http://bytes.com/topic/php/answers/620062-how-handle-php-execution-timeouts-gracefully

What I don't understand is why we cannot connect at times on Remote Desktop, though.

Tuesday, July 16, 2013

MySQL WorkBench problem cannot create user

'Unhandled exception: Error creating account' error message when creating an account in mySQL Workbench.

I'm using workbench 5.2.31 CE.

This problem have popped up, when I'm trying to create a user in mySQL.  

There are two steps to work around this:
  1. edit the sql-mode configuration.  It can be found under Advance tab, Edit the text of sql-mode.  Remove the part "NO_AUTO_CREATE_USER," or cut it.  Then paste it back after you have created your user.
  2. Run the grant all previleges script as instructed below.

The solution is very simple.  You just have to run one of this statement in the Workbench Query window:

GRANT ALL PRIVILEGES ON *.* TO changetousername@localhost;
GRANT ALL PRIVILEGES ON *.* TO 'changetousername'@'%';

This will create an account without password.  So better set the password and change the previleges.

I don't know if this is the best work around or the worst.  But if you are desperate to add a user account.  This is the way that worked for me.

Here is part of the source of the solution:
http://stackoverflow.com/questions/15673640/unhandled-exception-error-creating-account