holibert / wlan-pos

Automatically exported from code.google.com/p/wlan-pos
0 stars 0 forks source link

MySQL DB create user error: 'ERROR 1044: Access denied for user: '@localhost' to database' #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. mysql -uroot -p
2. grant all privileges on wlanpos.* to pos@'%' identified by 'pos'

What is the expected output? What do you see instead?
ERROR 1044: Access denied for user: 'root@localhost' to database 'wlanpos'

Solution:
1.backing up all db with:
mysqldump -uroot -p [dbname] > /path/to/bak/file
2.apt-get --purge remove mysql-server (be sure to rm /var/lib/mysql)
3.apt-get install mysql-server
4.create user and restore db
mysql -uroot -p -e 'create database wlanpos'
grant all privileges on wlanpos.* to pos@'%' identified by 'pos'
(pos@localhost first if '%' fails);
mysql -upos -p (login as pos)
mysql -uroot -p [dbname] < /path/to/bak/file

Original issue reported on code.google.com by xiaotian...@gmail.com on 31 Jan 2010 at 12:25

GoogleCodeExporter commented 8 years ago
--skip-lock-tables in backing up mysql db

Original comment by xiaotian...@gmail.com on 31 Jan 2010 at 12:27

GoogleCodeExporter commented 8 years ago

Original comment by xiaotian...@gmail.com on 14 Mar 2010 at 6:05