Add path to .bash_profile
export PATH="/usr/local/mysql/bin:$PATH"
You need to Change password before it starts
$ login - mysql -u root -p
mynsql > SET PASSWORD = PASSWORD('your_new_password');
UPDATE: To avoid all this, create a dump of your database and remove the first line in the backup file containing "DEFINER". Here is command to get it done quickly:
sed -i "" -e "s/.*50013 DEFINER=.*//g" <PATH TO FILE>
To develop locally one would want to bring in the the data from production over to staging or localhost. One limitation is that the views in the database are inked to creator - which differs from environment to environment. As an example, in production the user name might be prod_au_xyz and on localhost he might be called root. The error you might encounter is this:
DatabaseError: The user specified as a definer ('<user>'@'%') does not exist
To fix that execute the following query and then execute the resulting queries it produces:
SELECT CONCAT("ALTER DEFINER=
root@
localhost VIEW ", table_name, " AS ", view_definition, ";") FROM information_schema.views WHERE table_schema='<DB NAME>';
Note how the new definer is named root
. This is usually the case for localhost. If the same fix is needed for staging - make sure to replace root
with whatever username there is for staging.
More details: permissions - MySQL error 1449: The user specified as a...