My database (mysql) server is hosted on Mochahost.com . I have created an Event on my database, but its not running. I found that the event scheduler is turned off. I queried the following command
SET GLOBAL event_scheduler = ON
but it returned this error
"" #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
I checked and found that I dont have the privilege option available to create a user with Super privileges
Please help me how to fix this, do I need to contact the host support for this ?
As André said, this is something your host needs to allow (and probably won't in a shared hosting situation). Switching to a dedicated host is probably the only way to get full access to the database.
Related
I want to increase the max connections in my MySQL database hosted with AWS through vapor. Currently, it's only 64. I can see that in the vapor platform under databases -> my database but don't see where I can change it within the platform.
What is most confusing for me is that I don't know where to change it. Is it by changing something in Laravel? Running a SQL query, updating something in the AWS console, or changing something in the vapor dashboard?
I have tried to run this in the SQL console
set global max_connections = 1000;
but get back the error:
[42000][1227] Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation
Context: Telephony system (Asterisk) using the MySQL C API to connect to the database to lookup the routing for a call as it comes in. The lookup involves connecting to the database, executing a query, then closing the connection.
Sometimes the very first call in the morning generates the following error:
Access denied for user 'asterisk'#'127.0.0.1' (using password: YES)
Normally this would mean the password was wrong, but that's obviously not the case here, since it uses the same user and password all the time for all the calls. It's as if the system has somehow "gone to sleep" or perhaps a file handle has become stale somewhere, so that the first attempt to the connect to the database fails, but the rest work fine. Also it only happens occasionally, so I'm unable to replicate it - very strange!
I'm using Asterisk 1.8.32 with MySQL 5.5 on Debian 8.7.
It's a bit of a headscratcher, so I would be grateful for any suggestions!
First of all it is very bad idea use 1.8.* tree at current moment becuase of security feature.
Move to 11.* fix this issue.
Also you can do following in my.cnf
interactive_timeout=
Set to any value more then 4 days(weekend)
Other option is reload mysql module by crontab every 3 hrs.
Best option(except upgrade) is move from mysql to res_odbc, which have keepalive option. res_config_mysql considering deprecated, so any new systems should use ODBC.
I am building a website using Flask (Python) and I have all the application files on my computer but I use an external host (InMotionHosting) for the MySQL database that probably has settings that I can't change.
The problem is that I very often get the error code:
OperationalError: (_mysql_exceptions.OperationalError) (2006,'MySQL server has gone away')
I think this is due to the short "wait_timeout" or/and the "connect_timeout" variables that I can't change.
GLOBAL VARIABLES:
wait_timeout=30
connect_timeout=10
max_allowed_packet=5242880
SESSION VARIABLES:
wait_timeout=610
max_allowed_packet=5242880
set global wait_timeout=600;
Error Code: 1227. Access denied; you need (at least one of) the SUPER privilege(s) for this operation
Is there something I can do by myself or is this something I need to ask the host about? (I am a completely self thought newbie so would appreciate as educational answers as possible besides plain instructions if there is something I can do by myself. Thanks a lot!)
EDIT:
As this is a shared hosting I can't change the MySQL settings and I need to find a way to solve the problem by changing my Flask app code.
i've setup a new mysql user on a server that allows access from other servers. i can access it from my dev machine using the credentials i setup.
But on one of my other servers nothing happens when trying to log into mysql using the same credentials that worked on my dev box. any ideas what it might be?
all it does is hang.
Nothing gets added to log files on either the new DB server or the one i'm trying to access from.
i also tested this connection from another server, just to test if my dev box was a fluke andi could access. So all i can think is there's something "wrong" with the server i cant access from.
Please post your query that executes to create this user and privileges.
If you can’t remember the queries you can execute this in your target server to get details about user
SHOW GRANTS for 'root'#'localhost';
You may check these things also .
Firewall setup for the server from the trouble machine.
Can this machine connect to another sql server provided with similar access?
Execute select * from mysql.user ; and check you don’t have duplicates with
different access privileges or passwords .
turns out i had everything setup correctly, as i said i was able to use the same user across other servers just not this one.
turns out my server provider had a network firewall restricting mysql connections. removed and hey presto.
thanks #csf
Suppose a user has full read/write access to MySQL database. Is there any way (some parameter in connection string) to connect to database by the same username and password in read-only mode?
I want this without changing this user's permissions because the same user might require write permission too at some other time. This would be useful (if possible) to prevent accidental modification to database.
The answer to your question is
No, there's no way to specify read-only access in the connection string.
Alternatives are
1. Create sql user with read permission
MVC3 Read-Only MySql Connection String
2. create views or stored procedures with permissions checking logic in them
MS SQL Grant permission to only a view
MySQL Grant a user permission to only view a mysql view
3. Implement permissions layer in your business logic
Good Luck!
The best solution here is to create another account on the mysql server with readonly permissions, and connect using that.
Depending on your use case and what control you have you could have the code call "set transaction read only" immediately after connecting, or use the --init-command parameter on connect. This worked for a testing use case we have,
Here's the set transaction doc: https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html, similarly you can also set it as a session variable if that makes a difference https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_read_only.