85👍
You need to set ownership and permissions for directory:
chown -R mysql:mysql /var/lib/mysql/ #your mysql user may have different name
chmod -R 755 /var/lib/mysql/
Note: -R
makes commands recursive – you may omit it, if there is no subdirs in /var/lib/mysql/
.
37👍
This should work for Mac users:
sudo chown -R mysql:mysql /usr/local/mysql/
sudo chmod -R 755 /usr/local/mysql/
If this doesn’t work, try running which mysql
to see where your mysql installation is located, and then replace /usr/local/mysql/
in the command above with whatever is before the ‘bin’ directory.
For example, on my system which mysql
produces the following output:
/usr/local/mysql/bin/mysql
so my path is /usr/local/mysql/
- [Django]-Django Rest Framework: Disable field update after object is created
- [Django]-Django reverse lookup of foreign keys
- [Django]-How to use pdb.set_trace() in a Django unittest?
3👍
On CentOS/RedHat, you should do the same thing on a different path:
chown -R mysql:mysql /data/mysql/
chmod -R 755 /data/mysql/
- [Django]-How to properly use the "choices" field option in Django
- [Django]-'RelatedManager' object is not iterable Django
- [Django]-How to solve "Page not found (404)" error in Django?
1👍
chown -R mysql:mysql /var/lib/mysql/
chmod -R 755 /var/lib/mysql/
I can confirm that these two chmod statements worked for me (Webmin didn’t see the databases nor did show tables) but I’m not sure why I had to do this after setting up perhaps two dozen servers (Centos) with MySQL in that past few years.
- [Django]-How can I restrict Django's GenericForeignKey to a list of models?
- [Django]-Django 1.7 upgrade error: AppRegistryNotReady: Apps aren't loaded yet
- [Django]-Does django with mongodb make migrations a thing of the past?
0👍
osx high sierra use the following command solves the issue:
chown -R mysql:mysql /usr/local/mysql
- [Django]-What's the best solution for OpenID with Django?
- [Django]-Not able to create super user with Django manage.py
- [Django]-Django – how to visualize signals and save overrides?
0👍
if you installed mariadb using homebrew you can run the following the command for OS X
sudo chown -R mysql:mysql /var/lib/var/mysql/
sudo chmod -R 777 /usr/local/var/mysql/
- [Django]-How do I prevent fixtures from conflicting with django post_save signal code?
- [Django]-Django Admin Form for Many to many relationship
- [Django]-Django 1.4 – can't compare offset-naive and offset-aware datetimes