在新用户中创建数据库时拒绝用户访问

时间:2016-03-06 20:31:46

标签: mysql sql hive

我创建了一个新用户parashu @ localhost,我需要在其中创建一个数据库

mysql> GRANT ALL PRIVILEGES ON *.* TO 'parashu'@'localhost';
Query OK, 0 rows affected (0.00 sec)

我在root用户中使用过这些命令但未解决。

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> mysqladmin reload;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqladmin reload' at line 1

并且也使用了

mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*11B9028F347AE95EE039F02A8729496D29AD1616' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> show grants;
+-------------------------------------------------------------------------------------------------------------------------+
| Grants for parashu@localhost                                                                                            |
+-------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'parashu'@'localhost' IDENTIFIED BY PASSWORD '*CED889944E42FC9A28385BF832FA12BEE77F1D47' |
| GRANT ALL PRIVILEGES ON `school`.* TO 'parashu'@'localhost'                                                             |
+-------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

但没有解决问题请帮帮我。

 public void setAlarm(int hourAlarm,  int minutesAlarm, int numeroAlarm, boolean yesOrNoRepeatAlarm) {


    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, numeroAlarm, broadcastIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    Log.i("numeroAlarm", numeroAlarm + "");
    Calendar calendar = Calendar.getInstance();

    if( (calendar.get(Calendar.HOUR_OF_DAY) > hourAlarm) ||
            ( calendar.get(Calendar.HOUR_OF_DAY) == hourAlarm && calendar.get(Calendar.MINUTE) > minutesAlarm)) {

        calendar.add(Calendar.DATE, 1);
    }

    calendar.set(Calendar.HOUR_OF_DAY, hourAlarm);
    calendar.set(Calendar.MINUTE, minutesAlarm);

    Log.i("timeInMillis", calendar.getTimeInMillis() + "");
    Log.i("repeatingAlarm", yesOrNoRepeatAlarm + "");

    if(yesOrNoRepeatAlarm) {

        alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
    }
    else {

        alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
    }

}

0 个答案:

没有答案