Tag

MySQL

M

mysqli::prepare Fails Using ALTER TABLE in a Statement With Parameter Markers

m

Part of a project I’m working on requires re-setting a MySQL table by deleting most – but not all – rows. In PHP I’m using mysqli::prepare to prepare the MySQL statements.

$id = 5;
$query = $conn->prepare("DELETE FROM table WHERE id>?");

 

 

The MySQL statement includes a parameter marker – denoted by ? – which is then substituted for the value of the $id variable using mysqli::bind_param.

(more…)

Resetting MAMP’s MySQL Root User Password

R

Those of you familiar with MAMP will no doubt know that MAMP’s MySQL root user password is set to root by default and changing it is not as straightforward as it perhaps should be.

I’ve previously described a way of successfully changing the root user password providing, of course, that you know the current password. If you’ve forgotten it, this method will not work and a way of re-setting the password is required.

(more…)

Starting MAMP’s Apache and MySQL Servers at Login

S

Whether using XAMPP or MAMP to provide a local server environment I prefer to have the respective Apache and MySQL servers start when I login.

With XAMPP I use a launch daemon and this works perfectly. With MAMP it’s even easier as there’s an option to Start Servers when starting MAMP in MAMP’s preferences. I only need to add MAMP.app to my Login Items and MAMP’s servers will be up and running after logging in.

(more…)

Changing the MySQL Root User Password in MAMP

C

Having recently changed my local testing server environment from XAMPP to MAMP v2.0.5 I wanted to change the password for the MySQL root user. By default it’s set to root.

Changing the MySQL password for the root user was straightforward enough, but locating and editing the files to reflect the new password was a different story. Failure to update all the necessary files results in MAMP reporting the following error:

/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

(more…)

Recent Comments

Recent Posts