mysql server keyring Plugin installation - mysql

I have a mysql server installed on linux ubuntu and I am trying to install the keyring plugin. I have edited the my.cnf file located at /etc. The file was intially empty so I added the below content to it
[mysqld]
early-plugin-load=keyring_file.so
After doing the server restart , I ran the below query in workbench and I get zero results
SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'keyring%';
I am trying to follow this tutorial
https://dev.mysql.com/doc/refman/5.7/en/keyring-installation.html

This was resolved by having the value in the file /etc/mysql/my.cnf

Related

MySQL 8.0: Error on trying to install keyring

Using MySQL 8.0 and MySQL Workbench on Windows 10. Also using Command Prompt to interface with mysql after cd'ing into C:\Program Files\MySQL\MySQL Server 8.0\bin.
I'm trying to implement encryption data-at-rest on several tables on a database. However, after trying to install keyring_file.dll via
install plugin keyring_file soname 'keyring_file.dll';
I get the following error:
ERROR 1123 (HY000): Can't initialize function 'keyring_file'; Plugin initialization function failed.
I have added the following to my.cnf under mysqld:
[mysqld]
early-plugin-load=keyring_file.dll
keyring_file_data=C:/Program Files/MySQL/MySQL Server 8.0/lib/plugin/keyring_file
After restarting MySQL server via services.msc, I ran 'show variables like '%keyring%';' which returned the following:
Running the following:
SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'keyring%';
Also returned:
Not sure what I have done wrong or missed out. Looking at similar questions and solutions for this issue don't seem to work for some reason.
I have got the same problem, following steps resolve my issue
check error log and found the permission issue cause the problem.
create a folder "Plugin" on "C:\ProgramData\MySQL\MySQL Server 8.0" (data directory path).
copy keyring_file.dll from "C:\Program Files\MySQL\MySQL Server 8.0\lib\plugin" to "C:\ProgramData\MySQL\MySQL Server 8.0\Plugin".
set keyring_file_data=C:\ProgramData\MySQL\MySQL Server 8.0\Plugin\keyring in my.ini file.
restart the mysql service
execute mysql> install plugin keyring_file soname 'keyring_file.dll';

ERROR! MySQL is running but PID file could not be found

I'm running Mariadb 10.1.22 on Centos 7 and I am getting this error message when I'm trying to start the mysql service. I haven't changed the configuration file at all and I have pasted below what the file says about where my pid file is located
pid-file=/var/run/mariadb/mariadb.pid
On my server it doesn't have a run folder under the var folder but run is located on the base directory so I created a directory called mariadb in the run directory and added a file called mariadb.pid and used the chown command to assign it to the mysql group and then restarted and that did nothing. Does anyone know how to solve this issue?
Also running the rpm -qa mariadb* command sho
Maybe you are using a configuration file from MySQL, where this variable is written with the dash "pid-file", but for MariaDB according to documentation [1], you have to use an underscore "pid-file". It is not necessary to create new MariaDB directory in var/run, just use this parameter in your mariadb.cnf:
pid_file = /var/run/mysqld/mysqld.pid
[1] https://mariadb.com/docs/ent/ref/mdb/system-variables/pid_file/

Mariadb Error : Mysql server has gone away [import dump]

I am importing dump file in mariadb on windows . It show me "Mysql server has gone away" error . I knew the solution that add
max_allowed_packet=500M
in my.cnf but issue is that is have seen five init files in that directory
C:\Program Files\MariaDB 5.5
my-huge.ini
my-innodb-heavy-4G.ini
my-large.ini
my-medium.ini
my-small.ini
so in which file i change "max_allowed_packet=500M" .Please suggest to me how i change the configuration of mariadb on windows for this issue.
I have face same problem because configuration file did not work for me,so you have to pass max_allowed_packet value directly in a query.
mysql -u username -p --max_allowed_packet=1073741824 < dump.sql
None of these .ini files are used by your server, with default installation. Those are examples.
my.ini in the data directory is used, which in default installation is in
C:\Program Files\MariaDB 5.5\data

After install, mySQL doesn' start (windows10, source install)

I'm installing Apache server, php, and MySQL on Windows10.
First two was successful but MySQL has a problem.
I installed MySQL into C:\mysql-5.7.10-winx64, and changed my.ini like this
basedir = C:/mysql-5.7.10-winx64
datadir = C:/mysql-5.7.10-winx64/data
port = 3306
I succeeded install but if I try to start, it shows like below
C:\Windows\system32>net start mysql
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
However, if I check Computer Management>Event Viewer>Custom Views>Summary page events, it tells me "failed to set datadir to C:\mysql-5.7.10-winx64\data\"
If I make data folder manually, error message changed to
Can't open the mysql.plugin table
Please run mysql_upgrade to create it.." and some files are created in data folder
I tried to upgrade by typing mysql_upgrade but it failed.
mysql_upgrade: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) while connecting to the MySQL server. Upgrade process encountered error and will not continue.
How can I solve this issue?
Clear the "data" directory, then run command mysqld --initialize, and the command net start mysql, bingo!
1.For the error,
2003: Can't connect to MySQL server on 'localhost' (10061) while connecting to the MySQL server. Upgrade process encountered error and will not continue.
I ran the cmd as administrator and then go to \Program Files\MySQL\MySQL Server 5.7\bin\, and run
mysqld install
2.For the error,
C:\Program Files\MySQL\MySQL Server 5.7\bin>net start mysql
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
Try
mysqld --initialize
and then
net start mysql
Thanks to Athan's answer. Those combination worked for me.
I also had the same problem and I wasted hours solving the issue, but in the end this worked.
Go to you C:\ProgramData\MySQL\MySQL Server 5.7 and copy the my.ini file from there.
Go to C:\Program Files\MySQL\MySQL Server 5.7 and paste it there.
Open cmd and run net start mysql
It would work like a charm.
Explanation:
MySQL couldn't find my.ini, therefore tried to create data in Program Files... where it had no rights to do so, therefore it says access denied every time you run it.
This is old but I was running into the same problem you were seeing. I thought I'd share this answer for anyone looking. I created the data directory as you did initially and tried to start the service and got "Can't open and lock privilege tables: Table mysql.user doesn't exist." I then deleted the contents of the data directory and instead initialized the data directory by running the following command from the bin folder.
mysqld --initialize [with random root password]
mysqld --initialize-insecure [without random root password]
I had the same error, after checked this document: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html
I just clear data directory and add the --console option to initialize:
bin\mysqld --defaults-file=C:\my.ini
--initialize --console
Hope this help
MySQL Server can either be run as a Program or as a Service. You cannot run both. You should stop 'mysqld' Server Program before starting 'mysqld' Server as Service.
The 'mysqld' Server Program can be stopped either by typing
'CTRL + c' or by issuing
'mysqladmin -u root -p shutdown' command and issue the password when prompted.
You need download from https://dev.mysql.com/downloads/mysql/ previous GA versions, and after that copy directory "data" to your new mysql or outher directory what you write in configfile my.ini in directory mysql-"version" .
For your error, main cause is in your my.ini setting.
Since you are installing MySQL on Windows, you should define path like:
basedir = C:\\mysql-5.7.10-winx64
datadir = C:\\mysql-5.7.10-winx64\\data
These slashes must be doubled.
Then start your MySQL service again. I guess this time would work.
And here is official document from MySQL.
This saved my life,
Just turn off the windows firewall and Give he port number correctly as 3306 as default, then restart MYSQL server . After that turn on the windows defender firewall
Just work it fine.
Looks like my solution is not added yet,
I've installed mysql80 , edited my.ini in windows notepad and got the same error like topic author "... NET HELPMSG 3534." when I start mysql service,
and my issue was in extra bytes added by notepad at the begining (EB BB BF) on my.ini, when I edited (added the same changes) my.ini in other editor everything worked fine.

anyone get mysql workbench 5.2 to work with mamp?

i cannot get mysql workbench 5.2 to work. i have mamp and mamp pro installed and running and no matter what type of connection i try it just wont connect. what can i do?
i have a mac with snow leopard
In MySQL workbench use Connection Method: Local Connection/Pipe and in the setting Socket/Pipe path enter: /Applications/MAMP/tmp/mysql/mysql.sock then enter your root username/password.
There are two tasks that need to be fixed to get MySQL Workbench working with a MAMP installation:
1) The Start/Stop/Status commands for the MySql server need to changed from the Server Instance configuration to the following:
Set the Start MySQL command to:
/Applications/MAMP/bin/startMysql.sh
Set the Stop MySQL command to:
/Applications/MAMP/bin/startMysql.sh
Set the Check MySQL Status command to:
ps xa | grep "/Applications/MAMP/Library/bin/[m]ysqld"
2) The my.cnf file needs to be created manually and the appropriate permissions given through a terminal window:
Utilities -> Terminal
sudo touch /etc/my.cnf
sudo chown joeb /etc/my.cnf
Changed joeb with your username.
If you want a more detailed guide, see MAMP, MySQL Workbench, WordPress installation and setup guide for MAC.
I follwed these instructions and got it to work: http://chrischarlton.us/tip/using-mysql-workbench-mamp-pro