Syntax error or access violation 1142 references command denied to user

SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user #79 Comments // Provide a general summary of the issue in the Title above Getting error msg trying to import products. The error occurs on the SKU column. csv example attached. Preconditions // Provide a more detailed information about you Magento, Apache2/nginx, […]

Содержание

  1. SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user #79
  2. Comments
  3. Preconditions
  4. Steps to reproduce
  5. Actual result
  6. Syntax error or access violation 1142 references command denied to user
  7. foreign key between tenant and system db in migration is not possibile #807
  8. Comments
  9. [XT SQL Error] 1142 — INSERT command denied to user
  10. Сообщения 5
  11. 1 Тема от Vit 2007-09-01 15:31:44 (изменено: Vit, 2007-09-01 15:49:30)
  12. Тема: [XT SQL Error] 1142 — INSERT command denied to user
  13. 2 Ответ от Hanut 2007-09-01 16:44:11
  14. Re: [XT SQL Error] 1142 — INSERT command denied to user
  15. 3 Ответ от Vit 2007-09-01 22:31:23 (изменено: Vit, 2007-09-01 22:34:56)
  16. Re: [XT SQL Error] 1142 — INSERT command denied to user
  17. 4 Ответ от Hanut 2007-09-02 11:04:55
  18. Re: [XT SQL Error] 1142 — INSERT command denied to user
  19. Syntax error or access violation 1142 references command denied to user

SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user #79

// Provide a general summary of the issue in the Title above
Getting error msg trying to import products. The error occurs on the SKU column.

csv example attached.

Preconditions

// Provide a more detailed information about you Magento, Apache2/nginx, PHP & MySQL version
// Provide example CSV file to help us reproduce your issue
1.
Magento 2.3.3
MariaDB 10.
Apache 2.4

Steps to reproduce

// Provide a list of steps to reproduce this bug, include which plugins you use
// You can attach your magmi profile files stored in directory «/magmi/conf/
1.
2.
3.

Actual result

for table ‘catalog_product_entity’ — ERROR ON RECORD #2
SKU mag2604 — 3 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #3
SKU mag2606 — 4 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #4
SKU mag2607 — 5 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #5
SKU mag2608 — 6 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #6
SKU mag2609 — 7 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #7
SKU mag2610 — 8 SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user ‘resellerbay’@’%’ for table ‘catalog_product_entity’ — ERROR ON RECORD #8
Trace not found

this happens on every product sku

The text was updated successfully, but these errors were encountered:

Источник

Syntax error or access violation 1142 references command denied to user

In mu config/database.php n

‘mysql’ => [n ‘driver’ => ‘mysql’,n ‘url’ => env(‘DATABASE_URL’),n ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’),n ‘port’ => env(‘DB_PORT’, ‘3306’),n ‘database’ => env(‘DB_DATABASE’, ‘forge’),n ‘username’ => env(‘DB_USERNAME’, ‘forge’),n ‘password’ => env(‘DB_PASSWORD’, »),n ‘unix_socket’ => env(‘DB_SOCKET’, »),n ‘charset’ => ‘utf8mb4’,n ‘collation’ => ‘utf8mb4_unicode_ci’,n ‘prefix’ => »,n ‘prefix_indexes’ => true,n ‘strict’ => true,n ‘engine’ => null,n ‘options’ => extension_loaded(‘pdo_mysql’) ? array_filter([n PDO::MYSQL_ATTR_SSL_CA => env(‘MYSQL_ATTR_SSL_CA’),n ]) : [],n ],nn ‘secondary’ => [n ‘driver’ => ‘mysql’,n ‘url’ => env(‘DATABASE_URL_SECONDARY’),n ‘host’ => env(‘DB_HOST_SECONDARY’, ‘127.0.0.1’),n ‘port’ => env(‘DB_PORT_SECONDARY’, ‘3306’),n ‘database’ => env(‘DB_DATABASE_SECONDARY’, ‘forge’),n ‘username’ => env(‘DB_USERNAME_SECONDARY’, ‘forge’),n ‘password’ => env(‘DB_PASSWORD_SECONDARY’, »),n ‘unix_socket’ => env(‘DB_SOCKET_SECONDARY’, »),n ‘charset’ => ‘utf8mb4’,n ‘collation’ => ‘utf8mb4_unicode_ci’,n ‘prefix’ => »,n ‘prefix_indexes’ => true,n ‘strict’ => true,n ‘engine’ => null,n ‘options’ => extension_loaded(‘pdo_mysql’) ? array_filter([n PDO::MYSQL_ATTR_SSL_CA => env(‘MYSQL_ATTR_SSL_CA’),n ]) : [],n ],n n

Here is my query n

I assume they have the exact same username and password? n»,»bodyInMarkdown»:»I assume they have the exact same username and password?»,»replies»:[<«id»:755261,»conversation_id»:169691,»body»:»

Seems like a Mysql user privilege issue on the secondary — does that user have SELECT privilege on that database/table? n

tprotected $connection = ‘secondary’;n n

and use the laravel relationship to fetch data. In my case i solve it by doing this n

$response = ProductCode::with(‘buyer’)nttt->where(‘sales_by’, ‘!=’, 0)nttt// ->where(‘sales_by’, auth(‘api’)->id())nttt->whereNotNull(‘sales_by’);nttif (request()->query(‘search’)) <nttt$response = $response->where(«productcode», «LIKE», «%» . request()->query(‘search’) . «%»);ntt>;n n»,»bodyInMarkdown»:»@sheharyar nin your secondary modeln

ntprotected $connection = ‘secondary’;n

nnand use the laravel relationship to fetch data. In my case i solve it by doing thisnn

n$response = ProductCode::with(‘buyer’)nttt->where(‘sales_by’, ‘!=’, 0)nttt// ->where(‘sales_by’, auth(‘api’)->id())nttt->whereNotNull(‘sales_by’);nttif (request()->query(‘search’)) <nttt$response = $response->where(»productcode», »LIKE», »%» . request()->query(‘search’) . »%»);ntt>;n

tprotected $connection = ‘secondary’;n n

and use the laravel relationship to fetch data. In my case i solve it by doing this n

$response = ProductCode::with(‘buyer’)nttt->where(‘sales_by’, ‘!=’, 0)nttt// ->where(‘sales_by’, auth(‘api’)->id())nttt->whereNotNull(‘sales_by’);nttif (request()->query(‘search’)) <nttt$response = $response->where(«productcode», «LIKE», «%» . request()->query(‘search’) . «%»);ntt>;n n»,»bodyInMarkdown»:»@sheharyar nin your secondary modeln

ntprotected $connection = ‘secondary’;n

nnand use the laravel relationship to fetch data. In my case i solve it by doing thisnn

n$response = ProductCode::with(‘buyer’)nttt->where(‘sales_by’, ‘!=’, 0)nttt// ->where(‘sales_by’, auth(‘api’)->id())nttt->whereNotNull(‘sales_by’);nttif (request()->query(‘search’)) <nttt$response = $response->where(»productcode», »LIKE», »%» . request()->query(‘search’) . »%»);ntt>;n

Источник

foreign key between tenant and system db in migration is not possibile #807

Description

I’d like to have common lists (such as cities, countries, groups, vat_codes. ) in system db and have a foreign key with them in tenants db tables.

Schema::table(‘guests’, function (Blueprint $table) < $table->foreign(‘city_id’)->references(‘id’)->on(‘system.cities’); >)

When I run the migration command, get the below error.

Actual behavior
SQLSTATE[42000]: Syntax error or access violation: 1142 REFERENCES command denied to user ’85bf77ef76b04cfbb67362781730ccd4 ‘@’localhost’ for table ‘system.cities’

Expected behavior

I know this is expected due to user privileges (the tenant db user cannot access the system db). Is there a way to bypass this error? Thanks

Information

  • hyn/multi-tenant version: 5.4
  • laravel version: 5.8
  • database driver and version: mysql 5.7
  • webserver software and version: nginx 1.11.1
  • php version: 7.2

tenancy.php config

The text was updated successfully, but these errors were encountered:

Looks like your tenant user isn’t allowed to create a foreign key to the system database. Which.. actually makes a lot of sense. If you still want this, you might need to give the tenant database user additional privileges either through the config key or through an event listener..

Hi @nulele, I had a similar use case and thought I could share with you what I did to solve it (based on other issues and the documentation), but it is basically what @luceos suggested.

I just created a new listener, let’s say GrantPrivileges , to listen to the creation of new databases by the Hyn Tenancy and grant the necessary permissions to the new user.

So, you’d have, for example:

AppProvidersEventServiceProvider

AppListenersGrantPrivileges

The above query is for MySQL/MariaDB, but if you use another driver, it’s just a matter of adjusting it. So what I do here is just add the tables that I need to reference on the system’s DB from the tenant’s one to the $tables array attribute, and whenever a new database is created, the listener executes the GRANT to each of the tables defined and you can create the relationship on your migration files.

And just an extra tip here, on my migration files I don’t like to explicitly say that the name of the system connection is actually system (because that might not be true), so I request the database name, for example:

Источник

[XT SQL Error] 1142 — INSERT command denied to user

Форум PHP-MyAdmin.RU → MySQL & phpMyAdmin → [XT SQL Error] 1142 — INSERT command denied to user

Чтобы отправить ответ, вы должны войти или зарегистрироваться

Сообщения 5

1 Тема от Vit 2007-09-01 15:31:44 (изменено: Vit, 2007-09-01 15:49:30)

  • Vit
  • Участник
  • Неактивен
  • Зарегистрирован: 2006-04-10
  • Сообщений: 41

Тема: [XT SQL Error] 1142 — INSERT command denied to user

Я уже не совсем «чайник», но еще далеко не «профи», поэтому прошу с пониманием принимать мои возможно некорректные вопросы и высказывания.

Сегодня, обновляя товар в моем онлайн-магазине, вдруг получил сообщение об ошибке:

1142 — INSERT command denied to user ‘vitalijs_shop’@’supremecenter32.com’ for table ‘whos_online’

insert into whos_online (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values (», ‘Guest’, ‘e859c0aa91b1694673fb1d4200a4269f’, ‘91.17.221.25’, ‘1188647269’, ‘1188647269’, ‘/xtcommerce/index.php’)

1142 — INSERT command denied to user ‘vitalijs_shop’@’supremecenter32.com’ for table ‘sessions’

В магазин больше войти не могу, и, как оказалось, никто не может, вместо магазина появляется вышеприведенное сообщение об ошибке.

В phpMyAdmin зайти могу, но никакие действия произвести не могу, получаю сообщения типа «#1142 — CREATE command denied to user».
В БД пропала таблица «address_book».

Вкладку «Привилегии» обнаружить не могу.

Совершенно не понимаю, что происходит. Мог ли мой провайдер что-нибудь напортачить?
Может у кого-то что-нибудь подобное встречалось, или есть какие-то мысли по этому поводу?

P.S. phpMyAdmin 2.6.4-pl2

2 Ответ от Hanut 2007-09-01 16:44:11

  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,722

Re: [XT SQL Error] 1142 — INSERT command denied to user

Vit
Вероятно что-то проихошло с таблицей пользователей сервера MySQL. Обратитесь к хостеру. Как вы создавали пользователя MySQL? Возможно из панели управления сайтом. Попробуйте восстановить пользователя оттуда. А вот то что пропала какая-то таблица — это уже плохо, так как возможно сайт был взломан. Смотрите логи Apache.

3 Ответ от Vit 2007-09-01 22:31:23 (изменено: Vit, 2007-09-01 22:34:56)

  • Vit
  • Участник
  • Неактивен
  • Зарегистрирован: 2006-04-10
  • Сообщений: 41

Re: [XT SQL Error] 1142 — INSERT command denied to user

Все оказалось очень просто — я превысил оплаченный объем БД. Сделал апгрейд и все восстановилось, кроме таблицы «address_book». Но есть бэкап, восстановлю. Вероятно она пропала именно из-за превышения лимита, база освободила место под новые данные. Может такое быть?
А вот где искать «Привилегии» не понятно. В локальном phpMyAdmin такая закладка есть, а на сервере — нет. Правда, версии phpMyAdmin разные, может быть поэтому?
И еще: логи Апачи, это где?

4 Ответ от Hanut 2007-09-02 11:04:55

  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,722

Re: [XT SQL Error] 1142 — INSERT command denied to user

Сделал апгрейд и все восстановилось, кроме таблицы «address_book». Но есть бэкап, восстановлю. Вероятно она пропала именно из-за превышения лимита, база освободила место под новые данные. Может такое быть?

Ели честно, то я не понимаю, почему вы задаете эти вопросы на данном форуме, а не своему хостеру.

А вот где искать «Привилегии» не понятно. В локальном phpMyAdmin такая закладка есть, а на сервере — нет. Правда, версии phpMyAdmin разные, может быть поэтому?

У вас должна быть панель управления сайтом, например CPanel. Если ее нет, то опять-таки — к хостеру.

Источник

Syntax error or access violation 1142 references command denied to user

I’ve stumbled across a problem with my site which i need some help with, Let me start from the beginning. A few weeks ago i got a email from my hosting provider saying that my MYSQL database has exceeded the amount given. Im only allowed 1GB but apparently it was on 1.42GB. So after spending a couple hours just to figure out how to log into my hosting, my sql..ect (i forget passwords when i’ve not logged in for a year!) i can see the contents of mysql is in fact 762mb. Nowhere near 1.42gb that the hosting provider suggests (godaddy).

I also noticed, that my site is down. Im guessing godaddy revoked my database due to it being over the threshold. Heres a copy of the email they sent me:

The following schedule will be used to assist you with your efforts:

TUESDAY, FEBRUARY 07, 2017 (MST, GMT -7) — If the database remains above thresholds, your website access to the database content will be revoked. Your website will no longer be able to connect to the database for content.

TUESDAY, FEBRUARY 14, 2017 (MST, GMT -7) — If the database remains above thresholds, the database will be backed up (*if possible) and removed at that time. Your database will no longer exist on your hosting account.

Once you have reduced the database to within the acceptable thresholds, normal functionality will automatically be restored once again. Please allow up to one full hour for such changes to take effect.

Today the 10th i’ve only just started working on it. So im guessing on the 7th they revoked my database?. Well i can still access it ok. I even deleted it and restored a previous backup of the database.

Its been 5 hours since i spoke to them and the site still isn’t up and running. Heres a snapshot of the error when trying to access the site:

Does anyone have any ideas what i can do from here on?.

Источник

Having your own custom website is one of the most rewarding experiences you can have online, but from time to time, it can also throw seemingly random errors at you for no apparent reason. One of the more perplexing errors is MySQL error #1142 “INSERT command denied to user”. Unlike other errors, this particular issue can pop up in almost all content management systems, in phpMyAdmin, and even in code that you have written yourself. In this article, we will learn what causes the #1142 error and we will go over the possible solutions to this issue.

As the error message ”INSERT command denied to user” suggests, the root problem is that the INSERT command fails. The INSERT command is used to add new information to your MySQL database. So, you can potentially run into this problem whenever you update your website with new information or when you try to manually insert new data into your database.

Since this is a database-related issue, it can pop up on any website that uses a database to store information. The issue can affect everything from world-renowned content management systems like WordPress, Joomla, and Drupal, to small PHP websites that you may have coded yourself.

If you have a Joomla website and you run into the "INSERT command denied to user" problem, you may see a message similar to this one.

If you have a Joomla website and you run into the “INSERT command denied to user” problem, you may see a message similar to this one.

The #1142 error is most prevalent in shared hosting environments. Plans such as our free website hosting and our premium shared hosting packages fall into this category. The reason is that shared hosting plans often impose a limit, known as a quota, on the amount of information that can be stored in a single database.

What Is a Database Quota?

As more information is stored in a database, its size steadily grows. That is why hosting companies often impose a database quota which is essentially a storage limit for your database. When you reach this limit, you are no longer permitted to add new information in the database. In technical terms, when you reach your database storage limit, your database user loses its INSERT privileges.

How Can I Check My Database Quota and Current Space Usage?

You can easily check the current size of your MySQL database as well as the database quota imposed by your hosting plan using the Database Manager section of the Control Panel, as is shown below:

The Database Manager has a dedicated Quota column where you can easily compare your current space usage to the maximum that is allowed by your hosting plan.

The Database Manager has a dedicated Quota column where you can easily compare your current space usage to the maximum that is allowed by your hosting plan.

The only thing that we need to point out is that your current utilization statistics are not updated in real-time. As such, it may take an hour or so for any changes to the size of your database to be reflected in our Database Manager.

How Do I Fix MySQL Error #1142 “INSERT Command Denied to User”?

There are three approaches you can take to resolve the ”INSERT command denied to user” problem:

  • you can optimize your database in order to reduce its size without sacrificing any of your data.
  • you can delete information that you no longer need.
  • you can upgrade to a better hosting plan that grants you additional database storage.

Below we will discuss the three options in greater detail.

Option 1: Optimize the Database

Optimizing the database is arguably the best approach to take as it allows you to instantly reduce your database’s size without sacrificing any data. The only downside to this option is that for large websites this can prove to be only a temporary solution.

To optimize your database, follow the steps below:

  1. Go to the Database Manager section of our Control Panel.
  2. Click on the name of the database that is over quota.
  3. Open the Management tab.
  4. Choose the 1-click Optimization option, as is shown in the screenshot below:

Optimizing your database is truly a one-click solution thanks to our Database Manager.

Optimizing your database is truly a one-click solution thanks to our Database Manager.
  1. At this point, your database is optimized. However, it may take some time for this optimization to be reflected. To speed up the process, scroll further down the list of management options and choose the 1-click Permissions Fix button. By doing so, you will be granted full access to your database immediately and you can continue working on your website.

Using the 1-click Permissions Fix button you can speed up the optimization process allowing you to continue working on your website immediately.

Using the 1-click Permissions Fix button you can speed up the optimization process allowing you to continue working on your website immediately.

For more information on how database optimization works and the different ways of optimizing your database that you have available, you can refer to our full guide on how to optimize a MySQL database.

Option 2: Delete Unnecessary Data

Your other alternative when it comes to reducing your database size is to straight-up delete any data that is no longer necessary. This can be achieved using phpMyAdmin to DROP (delete) any tables that you no longer need. An example of this can be seen below:

Removing unnecessary information from the database is a sure-fire way of reducing its size.

Removing unnecessary information from the database is a sure-fire way of reducing its size.

Some website software products offer the ability for you to log every site visit for further analysis at a later time. Such information is often stored in your database. While this may be a useful feature to some, it can very quickly take up the majority of your database, especially if you have regular site visitors who spend plenty of time on your site. Disabling this logging functionality and removing the existing logs from the database can free up hundreds of megabytes.

Another aspect of running a website that can consume a lot of database storage is user-generated content such as reader comments on a blog post. At the very least you should ensure that no SPAM comments are published as are not helpful in the slightest and take up valuable storage space. An even better approach would be to consider using a service like DISQUS as it not only helps protect you against SPAM comments, it even stores all comments on its own servers so they are not taking up any space at all in your database.

Option 3: Upgrade to a Better Hosting Plan

The last option that you have at your disposal is to upgrade to a better hosting plan. The next tier of hosting will always offer you more storage for your databases and our premier plans like the Max Pack Plus and all of our Semi-Dedicated web servers will provide you with unlimited storage, thus dealing with the #1142 error once and for all.

If all else fails, you can always upgrade to a hosting plan that offers unlimited database storage.

If all else fails, you can always upgrade to a hosting plan that offers unlimited database storage.

If you are using one of our Virtual Private Server packages and you run into the “INSERT command denied to user” error, it is possible that your VPS has run out of space and there is simply no room for additional information to be stored. Once you confirm that the lack of storage is indeed the issue, you can purchase additional disk space for your VPS through our Control Panel.

Conclusion

When you are using a shared hosting server, you can solve the MySQL error #1142 “INSERT command denied to user” by making sure that your current database utilization does not exceed your database quota. This can be done by optimizing the database, deleting data, or just increasing your database quota. Sadly, some content management systems use different wording for the exact same error, so if your hosting plan limits the maximum size of your MySQL database, it is always a good idea to regularly check that you are not reaching your storage limit.


Keep reading

  • How Do I Fix the “Can’t Connect to Local MySQL Server Through Socket” Error?

Сегодня при изучении mysql, операции с медовым соком, при повторном использовании mysql я обнаружил, что независимо от того, какая подкоманда, возникает ошибка
mysql> select user,password from mysql.user;
ERROR 1142 (42000): SELECT command denied to user ‘root’@‘localhost’ for table ‘user’
После прочтения сообщения об ошибке разрешения недостаточно. , , Нет разрешения, так что просто дайте ему разрешение

step01

Выйдите из базы данных и закройте службу mysql.
 mysql> quit
 Bye
 [[email protected] ~]# /etc/init.d/mysqld stop
 Shutting down MySQL.. SUCCESS! 

step02

Запустите mysql в безопасном режиме, войдите в систему как пользователь root
 [[email protected] ~]# mysqld_safe --skip-grant-tables &
 [[email protected] ~]# mysql -uroot -p123 mysql

step03

Переключение базы данных и просмотр локальных прав пользователя root в табличной информации
 mysql> use mysql;
 Database changed
 mysql> show tables;
 +---------------------------+
 | Tables_in_mysql           |
 +---------------------------+
 | columns_priv              |
 | db                        |
 | event                     |
 | func                      |
 | general_log               |
 | help_category             |
 | help_keyword              |
 | help_relation             |
 | help_topic                |
 | innodb_index_stats        |
 | innodb_table_stats        |
 | ndb_binlog_index          |
 | plugin                    |
 | proc                      |
 | procs_priv                |
 | proxies_priv              |
 | servers                   |
 | slave_master_info         |
 | slave_relay_log_info      |
 | slave_worker_info         |
 | slow_log                  |
 | tables_priv               |
 | time_zone                 |
 | time_zone_leap_second     |
 | time_zone_name            |
 | time_zone_transition      |
 | time_zone_transition_type |
 | user                      |
 +---------------------------+
 28 rows in set (0.00 sec)
 
 mysql> select * from user where user='root' and host='localhost'G;
 *************************** 1. row ***************************
                   Host: localhost
                   User: root
               Password: *23AE809DDACAF96AF0FD78ED04B6A265E05AA257
            Select_priv: N
            Insert_priv: N
            Update_priv: N
            Delete_priv: N
            Create_priv: N
              Drop_priv: N
            Reload_priv: N
          Shutdown_priv: N
           Process_priv: N
              File_priv: N
             Grant_priv: N
        References_priv: N
             Index_priv: N
             Alter_priv: N
           Show_db_priv: N
             Super_priv: N
  Create_tmp_table_priv: N
       Lock_tables_priv: N
           Execute_priv: N
        Repl_slave_priv: N
       Repl_client_priv: N
       Create_view_priv: N
         Show_view_priv: N
    Create_routine_priv: N
     Alter_routine_priv: N
       Create_user_priv: N
             Event_priv: N
           Trigger_priv: N
 Create_tablespace_priv: N
               ssl_type: 
             ssl_cipher: 
            x509_issuer: 
           x509_subject: 
          max_questions: 0
            max_updates: 0
        max_connections: 0
   max_user_connections: 0
                 plugin: mysql_native_password
  authentication_string: NULL
       password_expired: N
 1 row in set (0.00 sec)
 
 ERROR: 
 No query specified
Здесь обнаружено, что все они N, что указывает на то, что пользователь root не имеет права на локальный вход

step04

Изменить права локального хоста пользователя root
 mysql> update user set `Insert_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Update_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Delete_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Create_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Drop_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Reload_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Shutdown_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Process_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `File_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Grant_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `References_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Index_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Alter_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Show_db_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Super_priv` ='Y',`Create_tmp_table_priv` = 'Y' where user='root'' and host='localhost';
 
 
 mysql> update user set `Lock_tables_priv` ='Y' where user='root' and host='localhost';  
 
 mysql> update user set `Execute_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Repl_slave_priv` ='Y' where user='root' and host='localhost';
 
 
 mysql> update user set `Repl_client_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Create_view_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Show_view_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Create_routine_priv` ='Y' where user='root' and host='localhost'';
 
 mysql> update user set `Alter_routine_priv` ='Y' where user='root' and host='localhost';;
 
 mysql> update user set `Create_user_priv` ='Y' where user='root' and host='localhost'; 
 
 mysql> update user set `Event_priv` ='Y' where user='root' and host='localhost';
 
 mysql> update user set `Trigger_priv` ='Y' where user='root' and host='localhost';
 
 mysql> flush privileges;
 Query OK, 0 rows affected (0.00 sec)
Я немного глупый здесь. , , Я выбил его один за другим, и я могу напрямую использовать «,», чтобы закончить писать один раз ,,,

step05

Выйти и перезагрузить и войти
 mysql> quit
 Bye
 [[email protected] ~]# /etc/init.d/mysqld restart
 Shutting down MySQL.. SUCCESS! 
 Starting MySQL.. SUCCESS! 
 [[email protected] ~]# mysql -uroot -p123

step06

Переключить библиотеку
 mysql> use mysql;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A
 
 Database changed

step07

Просмотр информации таблицы
 mysql> select * from userG;
 *************************** 1. row ***************************
                   Host: localhost
                   User: root
               Password: *23AE809DDACAF96AF0FD78ED04B6A265E05AA257
            Select_priv: Y
            Insert_priv: Y
            Update_priv: Y
            Delete_priv: Y
            Create_priv: Y
              Drop_priv: Y
            Reload_priv: Y
          Shutdown_priv: Y
           Process_priv: Y
              File_priv: Y
             Grant_priv: Y
        References_priv: Y
             Index_priv: Y
             Alter_priv: Y
           Show_db_priv: Y
             Super_priv: Y
  Create_tmp_table_priv: Y
       Lock_tables_priv: Y
           Execute_priv: Y
        Repl_slave_priv: Y
       Repl_client_priv: Y
       Create_view_priv: Y
         Show_view_priv: Y
    Create_routine_priv: Y
     Alter_routine_priv: Y
       Create_user_priv: Y
             Event_priv: Y
           Trigger_priv: Y
 Create_tablespace_priv: N
               ssl_type: 
             ssl_cipher: 
            x509_issuer: 
           x509_subject: 
          max_questions: 0
            max_updates: 0
        max_connections: 0
   max_user_connections: 0
                 plugin: mysql_native_password
  authentication_string: NULL
       password_expired: N
 1 row in set (0.01 sec)
 
 ERROR: 
 No query specified
 
 Разрешения в основном там
Проверьте это
 mysql> create database jinc;
 Query OK, 1 row affected (0.00 sec)
 
 mysql> select user,host from mysql.user;
 +------+-----------+
 | user | host      |
 +------+-----------+
 | root | localhost |
 +------+-----------+
 1 row in set (0.00 sec)
 
 mysql> drop database jinc;
 Query OK, 0 rows affected (0.00 sec)

Хорошо, основные разрешения вернулись

Понравилась статья? Поделить с друзьями:
  • Syntax error or access violation 1064 you have an error in your sql syntax drupal
  • Syntax error or access violation 1064 mysql
  • Syntax error or access violation 1059 identifier name is too long
  • Syntax error or access violation 1055
  • Syntax error operator priority clash