Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
0
votes
0
answers
65
views
MySQL Processlist slowly filling up with processes of state "login" and info "PLUGIN", eventually causing error 08004/1040: Too many connections
I've got a pretty basic Linux system (Debian 12) with MySQL/Percona Server 8.0.37 for Linux, using the caching_sha2_password authentication plugin for logging in onto MySQL. All my PHP-scripts (not using user root to login to MySQL!) use the `mysqli::close()` method at the end of the files/in the `_...
I've got a pretty basic Linux system (Debian 12) with MySQL/Percona Server 8.0.37 for Linux, using the caching_sha2_password authentication plugin for logging in onto MySQL.
All my PHP-scripts (not using user root to login to MySQL!) use the
mysqli::close()
method at the end of the files/in the __destruct
of the classes. When testing, I've got no I have no reason to believe that at the end of a script, connections aren't closed properly.
For some reason, over time (*couple of weeks/months*), the MySQL processlist is slowly filling up with processes with state "login" and info "PLUGIN", see also the output below and the attached screenshot.
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
| Id | User | Host | db | Command | Time | State | Info | Time_ms | Rows_sent | Rows_examined |
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
| 6 | event_scheduler | localhost | | Daemon | 709122 | Waiting on empty queue | | 709122565 | 0 | 0 |
| 3740365 | root | localhost | | Sleep | 622722 | login | PLUGIN | 622722577 | 0 | 0 |
| 7453355 | root | localhost | | Sleep | 536322 | login | PLUGIN | 536322576 | 0 | 0 |
| 11165124 | root | localhost | | Sleep | 449922 | login | PLUGIN | 449922576 | 0 | 0 |
| 14877373 | root | localhost | | Sleep | 363522 | login | PLUGIN | 363522575 | 0 | 0 |
| 18589114 | root | localhost | | Sleep | 277122 | login | PLUGIN | 277122575 | 0 | 0 |
| 22302053 | root | localhost | | Sleep | 190722 | login | PLUGIN | 190722575 | 0 | 0 |
| 26013793 | root | localhost | | Sleep | 104322 | login | PLUGIN | 104322574 | 0 | 0 |
| 29724803 | root | localhost | | Sleep | 17922 | login | PLUGIN | 17922574 | 0 | 0 |
| 30494127 | root | localhost:57288 | | Query | 0 | init | show processlist | 0 | 0 | 0 |
+----------+----------------------+-----------------+----------------------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
[](https://i.sstatic.net/OSjd6J18.png)
Eventually, after a significant amount of time, these processes take up all the MySQL connections (151, default setting), causing error 08004/1040: Too many connections, leaving no room for any PHP script to connect anymore.
Using SELECT user, host, plugin FROM mysql.user WHERE user = 'root'
, I've narrowed it down to the caching_sha2_password plugin.
[](https://i.sstatic.net/bZJiQvCU.png)
Killing them, using KILL
on the CLI from MySQL only changes the Command from "Sleep" to "Killed", but they remain in the processlist.
Restarting the MySQL server seems to fix the issue, but after some time, the same behaviour occurs again.
Anyone got any clues what is causing this and how to prevent this? Killing the MySQL server every 4 weeks doesn't really feels like a solution.
Bazardshoxer
(101 rep)
Jan 22, 2025, 09:46 PM
• Last activity: Jan 23, 2025, 07:17 AM
1
votes
1
answers
1033
views
MySQL Plugin "mysql_old_password" not loaded
In an attempt to fix another issue I had, I ran the commands below (as per https://dev.mysql.com/doc/refman/5.6/en/old-client.html) ```sql mysql> UPDATE mysql.user SET plugin = 'mysql_old_password' mysql> WHERE User = 'root' AND Host = 'localhost'; mysql> FLUSH PRIVILEGES; mysql> SET PASSWORD FOR ->...
In an attempt to fix another issue I had, I ran the commands below (as per https://dev.mysql.com/doc/refman/5.6/en/old-client.html)
mysql> UPDATE mysql.user SET plugin = 'mysql_old_password'
mysql> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR
-> 'root'@'localhost' = OLD_PASSWORD('new_password');
And now I'm unable to even get access to mysql through mysql -u root
because it gives me the error ERROR 1524 (HY000): Plugin 'mysql_old_password' is not loaded
. I can't run mysqladmin
and sudo mysqld_safe --skip-grant-tables
gives me the error
51759
my-username@Macbook-Pro ~ %
+ suspended (tty output) sudo mysqld_safe --skip-grant-tables
When I tried to run mysqld --old-password=1
I got a whole lot of 2022-08-17T11:10:18.149573Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35
I have tried uninstalling and reinstalling using homebrew for macOS, when that didn't work I also tried manually installing mysql from the website but that didn't work either.
(I use mysql version 8.0.30 for macOS 12.4)
The Royal Guardian
(31 rep)
Aug 17, 2022, 01:32 PM
• Last activity: May 28, 2024, 09:44 AM
1
votes
0
answers
186
views
Does MariaDB support server-side query rewriting?
MySQL has something called "[The Rewriter Query Rewrite Plugin](https://dev.mysql.com/doc/refman/8.0/en/rewriter-query-rewrite-plugin.html)". I've tried to find info about anything similar in MariaDB but so far found nothing. Is there any way in MariaDB to examine and modify SQL statements received...
MySQL has something called "[The Rewriter Query Rewrite Plugin](https://dev.mysql.com/doc/refman/8.0/en/rewriter-query-rewrite-plugin.html) ". I've tried to find info about anything similar in MariaDB but so far found nothing. Is there any way in MariaDB to examine and modify SQL statements received by the server before the server executes them? Or is it possible (and safe) to use MySQL plugins in MariaDB 10+?
EDIT: I just found out that [work on "Query Rewrite Plugin API" on MariaDB side is "stalled"](https://jira.mariadb.org/browse/MDEV-5561) . BUT in the comments people mention that there are some workarounds by using existing audit plugins. I am looking for any info about that.
EDIT 2: I know that third-party software (like MaxScale or ProxySQL) can be used as a proxy with capabilities to rewrite queries but this is not what I am asking about. I ask about query rewrite mechanisms that utilise only MariaDB server engine/package.
Grzegorz Adam Kowalski
(131 rep)
Apr 2, 2023, 04:01 PM
• Last activity: Apr 3, 2023, 07:04 PM
34
votes
1
answers
214638
views
What is mysql_native_password?
I was trying to set password for `root`. When I run: mysql> SELECT * from mysql.user where User="root"; It shows: +-----------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+--------------...
I was trying to set password for
root
. When I run:
mysql> SELECT * from mysql.user where User="root";
It shows:
+-----------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+-----------------------+-------------------+----------------+
| Host | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string | password_expired | password_last_changed | password_lifetime | account_locked |
+-----------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+-----------------------+-------------------+----------------+
| localhost | root | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | mysql_native_password | | N | 2018-06-13 15:11:59 | NULL | N |
+-----------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+------------------+-----------------------+-------------------+----------------+
This [Document](https://dev.mysql.com/doc/refman/5.5/en/native-pluggable-authentication.html) says that,
> The mysql_native_password native authentication plugin is backward
> compatible. Older clients that do not support authentication plugins
> do use the native authentication protocol, so they can connect to
> servers that support pluggable authentication.
But technically I'm not getting much. Does it have to do anything with root
user password?
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
and
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
Does it make any difference?
d a i s y
(443 rep)
Jun 13, 2018, 10:19 AM
• Last activity: Apr 27, 2021, 05:57 PM
0
votes
1
answers
46
views
Passively load a monitoring shared object into an Oracle process
I'm trying to load my own code, which should add some security features to my environment, into each oracle BEQ dedicated process. The reason I'm posting this on this platform, is that I hope there is some DBA hack to trick Oracle to load my shared object when a new instance of oracle starts to run....
I'm trying to load my own code, which should add some security features to my environment, into each oracle BEQ dedicated process.
The reason I'm posting this on this platform, is that I hope there is some DBA hack to trick Oracle to load my shared object when a new instance of oracle starts to run.
I have found out about external_libraries that in first glance seemed to fit, but after investigating how it works, I'm have found out that the library is being loaded into another external process and the loading will only happen on triggering a specific external function.
I know DB2 has an option to load external plugins to add functionality to the database (e.g 1 , 2 and 3 ) - this would fulfill my needs. - Again, I'm not intrested in the actual logic behind the plugin, all I want is the oracle to pull/load me passively into it's memory space when it starts.
Can you think of anything?
Thanks
Eytan Naim
(118 rep)
Jul 9, 2020, 12:02 PM
• Last activity: Jul 9, 2020, 12:51 PM
1
votes
1
answers
101
views
Is there some plugin that would reconnect query tabs to original DB's in SSMS?
It's a minor thing, but annoying one. I'm currently working on about 5 different databases, and every time I restore db's from snapshots or run my restore from backup scripts, all of the queries get disconnected. Sure, I can just rerun them, but the db is set to 'master' by default (yes, writing `us...
It's a minor thing, but annoying one.
I'm currently working on about 5 different databases, and every time I restore db's from snapshots or run my restore from backup scripts, all of the queries get disconnected.
Sure, I can just rerun them, but the db is set to 'master' by default (yes, writing
use mydbx
at the beginning of query is useful, but often forgotten, and I usually have two pages of various scripts in each).
Is there some plugin out there that would remember which query was on which db, and reconnect automatically from time to time?
veljkoz
(195 rep)
Jun 8, 2020, 08:02 AM
• Last activity: Jun 11, 2020, 01:15 AM
0
votes
1
answers
87
views
With Postgresql v10 and WAL2JSON... Is it possible to include the database name / datname in the json?
We have a set of databases that were not set up in a multi-tenant fashion. Looking to build a hub that will hold the data in a multi-tenant fashion using wal2json to pipe data from source to the hub. With each JSON object, I need to know which database it's coming from. Is this possible?
We have a set of databases that were not set up in a multi-tenant fashion. Looking to build a hub that will hold the data in a multi-tenant fashion using wal2json to pipe data from source to the hub. With each JSON object, I need to know which database it's coming from. Is this possible?
Andy Norris
(15 rep)
Mar 6, 2020, 06:04 PM
• Last activity: Mar 7, 2020, 08:42 AM
3
votes
2
answers
3388
views
PostgreSQL How do I convert struct text to plain *char in C functions?
I'm using my internal C function which doesn't know about postgresql's text struct, how do I pass text argument when char * expected? #include #include #include "postgres.h" #include "fmgr.h" #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif PG_FUNCTION_INFO_V1(fun); Datum fun(PG_FUNCTION_ARGS) { text...
I'm using my internal C function which doesn't know about postgresql's text struct, how do I pass text argument when char * expected?
#include
#include
#include "postgres.h"
#include "fmgr.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
PG_FUNCTION_INFO_V1(fun);
Datum fun(PG_FUNCTION_ARGS)
{
text *str1, *str2;
str1 = PG_GETARG_TEXT_P(0);
str2 = PG_GETARG_TEXT_P(1);
FILE *fp = fopen("/tmp/fun.log", "w");
fprintf(fp, "%s\n", VARDATA_ANY(str1));
fprintf(fp, "%s\n", VARDATA_ANY(str2));
fclose(fp);
PG_RETURN_INT32(0);
}
Here's what xxd sees in log file:
0000000: 666f 6f74 6261 6c6c c88d 7409 70d3 6b09 football..t.p.k.
0000010: 080a 7a6f 6f6d 0a ..zoom.
After executing:
SELECT * FROM fun('football','zoom');
Why junk after football?
Moe
(41 rep)
Jan 18, 2013, 02:12 PM
• Last activity: Feb 3, 2020, 01:28 PM
1
votes
1
answers
3723
views
Unable to change root user unix_socket to mysql_native_password
Server version: 10.1.41-MariaDB-0+deb9u1 Debian 9.9 I have installed a LAMP stack on my Debian 9 machine and can not log in with the root user. From my searching, it seems that it's because the install commonly creates a root user without a password, causing it to default to unix_socket, which foils...
Server version: 10.1.41-MariaDB-0+deb9u1 Debian 9.9
I have installed a LAMP stack on my Debian 9 machine and can not log in with the root user. From my searching, it seems that it's because the install commonly creates a root user without a password, causing it to default to unix_socket, which foils logging in with that user via terminal.
MariaDB [(none)]> SELECT user,authentication_string,plugin,host FROM mysql.user;
+------------+-------------------------------------------+-------------+-----------+
| user | authentication_string | plugin | host |
+------------+-------------------------------------------+-------------+-----------+
| root | *3624F23A73825C0D79BF3591774631513FE76C24 | unix_socket | localhost | | phpmyadmin | | | localhost |
+------------+-------------------------------------------+-------------+-----------+
2 rows in set (0.00 sec)
I found an article explaining how to resolve this issue by shutting down mysql, starting it with
sudo mysqld_safe --skip-grant-tables &
so I can log in and then running:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
then stopping and starting the daemon. My problem is that no matter how I format this line, I get:
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MariaDB server version for the right
> syntax to use near 'user 'root'@'localhost' IDENTIFIED WITH
> mysql_native_password BY 'mypass'' at line 1
I've tried tons of different formatting with backtics, case change and other iterations of the command found on the web but everything fails with the same result.
Could someone tell me how I go about changing this successfully?
Schwim Dandy
(25 rep)
Dec 5, 2019, 06:51 PM
• Last activity: Dec 5, 2019, 07:46 PM
1
votes
1
answers
173
views
How to use mysql_plugin utility?
I tried to follow [this][1] official documentation to install unix_socket plugin using mysql_plugin utility but getting an error that > Cannot read plugin config file unix_socket. Bad format in plugin > configuration file. FROM alpine:edge RUN set -ex \ && apk add mariadb mariadb-client \ && mysql_i...
I tried to follow this official documentation to install unix_socket plugin using mysql_plugin utility but getting an error that
> Cannot read plugin config file unix_socket. Bad format in plugin
> configuration file.
FROM alpine:edge
RUN set -ex \
&& apk add mariadb mariadb-client \
&& mysql_install_db --user=mysql --skip-name-resolve \
&& echo 'auth_socket' >> /usr/lib/mariadb/plugin/unix_socket.ini \
&& mysql_plugin --basedir=/usr --datadir=/var/lib/mysql --plugin_dir=/usr/lib/mariadb/plugin unix_socket ENABLE
CMD ["mysqld"]
I cross checked the ini file.
cat /usr/lib/mariadb/plugin/unix_socket.ini
auth_socket
SkyRar
(125 rep)
Jan 9, 2019, 09:08 PM
• Last activity: Jan 13, 2019, 10:26 PM
2
votes
1
answers
27684
views
MySQL reads Date columns in Excel as DateTime?
I'm trying to export Excel sheets to MySQL as new table using the plugin. The export fails on "MySQL error 1064" when I tried to change the data type to Date. I have a few columns in Excel that are formatted as Short Date, although some of them are generated by functions like =TODAY(), some are numb...
I'm trying to export Excel sheets to MySQL as new table using the plugin.
The export fails on "MySQL error 1064" when I tried to change the data type to Date.
I have a few columns in Excel that are formatted as Short Date, although some of them are generated by functions like =TODAY(), some are numbers like "42445", etc.
But all of them date type not Date Time.
For example it bothers me that MySQL detects '1/1/2016' in Excel as '1/1/2016 12:00:00 AM' as VarChar(225). And whenever I changed the type to Date the error message mentioned above appears.
I did try to re-format the columns in spreadsheet to YYYY-MM-DD but MySQL always convert them to MM/DD/YYYY HH:MM:SS
Thanks in advance for any help.
MySQL for Excel 1.3.6
Office 2016 32-bit
edit: this looks more like the plugin's bug of this version
https://bugs.mysql.com/bug.php?id=80079
cxwf
(141 rep)
Jul 13, 2016, 03:52 PM
• Last activity: Sep 19, 2018, 10:22 AM
1
votes
2
answers
5123
views
Ubuntu cannot open shared library mysqlx.so
### MySQL Server version: Ubuntu: 5.7.23-0ubuntu0.18.04.1-log (Ubuntu) MySQL installed using `apt-get`. When installing a plugin with the following command: mysql> INSTALL PLUGIN mysqlx SONAME 'mysqlx.so'; ...I receive the following error message: > ERROR 1126 (HY000): Can't open shared library '/us...
### MySQL Server version:
Ubuntu: 5.7.23-0ubuntu0.18.04.1-log (Ubuntu)
MySQL installed using
apt-get
.
When installing a plugin with the following command:
mysql> INSTALL PLUGIN mysqlx SONAME 'mysqlx.so';
...I receive the following error message:
> ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/mysqlx.so' (errno: 2 /usr/lib/mysql/plugin/mysqlx.so: cannot open shared object file: No such file or directory)
What can't Ubuntu locate/find the mysqlx.so
library?
vishnu
(21 rep)
Aug 7, 2018, 11:52 PM
• Last activity: Aug 9, 2018, 07:55 PM
2
votes
1
answers
312
views
SQL Management Studio - Add-on / Extension to view Column Data Type
Is there any way (built in) or free/paid add-on/Extension for SQL Management Studio that allows us to know exactly a data type of a column when we are writing a query? In this specific project I have had situations where by looking a the query result I am not exactly sure of the datatype, if it is a...
Is there any way (built in) or free/paid add-on/Extension for SQL Management Studio that allows us to know exactly a data type of a column when we are writing a query?
In this specific project I have had situations where by looking a the query result I am not exactly sure of the datatype, if it is a number written in a nvarchar(max) column.... or if it is a tinyint, or int, or bigint, etc....
And I am spending so much time just to drill on the "tree list" to reach a speficic table and expand the Columns node to find out what am I dealing with....
A situation when you have bunch of JOINS (and allias) and
sp_help
would require me always to go to some other query window and type more sql (table names).... then it would be **easier and faster just to have like a tooltip message of the column with extra info.**
Dryadwoods
(211 rep)
Mar 21, 2018, 09:47 AM
• Last activity: Jun 12, 2018, 08:54 AM
1
votes
1
answers
735
views
MySQL - Duplicate Entry when trying to install a Plugin
I'm trying to install a Plugin on my MySQL database, but each time I try I get a Duplicate Entry error: INSTALL PLUGIN audit_log SONAME 'audit_log.so'; Error Code: 1062. Duplicate entry 'audit_log' for key 'PRIMARY' But If I run: SHOW PLUGINS; SELECT * FROM `information_schema`.`plugins`; There is n...
I'm trying to install a Plugin on my MySQL database, but each time I try I get a Duplicate Entry error:
INSTALL PLUGIN audit_log SONAME 'audit_log.so';
Error Code: 1062. Duplicate entry 'audit_log' for key 'PRIMARY'
But If I run:
SHOW PLUGINS;
SELECT * FROM
information_schema
.plugins
;
There is no sign of it.
If I run SELECT * FROM mysql.plugin;
then there is an entry for it.
But If I run UNINSTALL PLUGIN audit_log;
then it tells me it doesn't exist. Error Code: 1305. PLUGIN audit_log does not exist
I know the file is there, because there are two databases on this server running under mysqld_multi
and it installed fine under the other one.
The server is 5.5.54, the server is Debian 8 (jessie).
Is there anything else I can do? Can I simply delete it from the mysql.plugin
table without causing problems? Restarting the server isn't feasible as it is my master database.
IGGt
(2276 rep)
Jun 6, 2017, 12:45 PM
• Last activity: Jun 6, 2017, 02:54 PM
3
votes
1
answers
19955
views
MariaDB: Disable the GSSAPI plugin
How can i disable the GSSAPI plugin? I do not need authentication via Kerberos on my server. This is my environment: - Centos 7.3 with SELinux mode enforcing - MariaDB Server: 10.1.19 In my log file */var/log/mariadb/mariadb.log* i see the next errors: [Warning] GSSAPI plugin : default principal 'ma...
How can i disable the GSSAPI plugin? I do not need authentication via Kerberos on my server.
This is my environment:
- Centos 7.3 with SELinux mode enforcing
- MariaDB Server: 10.1.19
In my log file */var/log/mariadb/mariadb.log* i see the next errors:
[Warning] GSSAPI plugin : default principal 'mariadb/locahost.local@' not found in keytab
[ERROR] mysqld: Server GSSAPI error (major 851968, minor 2529639093) : gss_acquire_cred failed -Unspecified GSS failure. Minor code may provide more information. Keytab FILE:/etc/krb5.keytab is nonexistent or empty.
[ERROR] Plugin 'gssapi' init function returned error.
I cannot find any related to that plugin in the configuration:
enter code here
> SELECT PLUGIN_NAME FROM information_schema.PLUGINS WHERE PLUGIN_TYPE = 'AUTHENTICATION';
+-----------------------+
| PLUGIN_NAME |
+-----------------------+
| mysql_native_password |
| mysql_old_password |
+-----------------------+
> SELECT * FROM mysql.plugin;
Empty set (0.00 sec)
I only found this configuration file:
- /etc/my.cnf.d/auth_gssapi.cnf
Lenin Meza
(133 rep)
Jan 5, 2017, 06:49 PM
• Last activity: Jan 5, 2017, 10:55 PM
3
votes
1
answers
1850
views
MySQL can't import a custom library for udf
I am working on Linux Mint 17 Qiana with MySQL Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64). Following the instructions found here: http://dev.mysql.com/doc/refman/5.7/en/adding-udf.html and subsequent pages, I have created a library file for my own user-defined function. But MySQL gives...
I am working on Linux Mint 17 Qiana with MySQL Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64).
Following the instructions found here:
http://dev.mysql.com/doc/refman/5.7/en/adding-udf.html
and subsequent pages, I have created a library file for my own user-defined function. But MySQL gives an error when I create the MySQL function from the library file.
Here are the steps I made.
I have created the following C file:
#include
#include
#include
#include
#include
//*** Functions for compressing a protein sequence into a binary
my_bool compress_protein_sequence_init(UDF_INIT* initid, UDF_ARGS* args, char* message) {
if(args->arg_count != 1) {
strcpy(message, "Error: compress_protein_sequence needs a string");
return 1;
}
if( args->arg_type != STRING_RESULT ) {
args->arg_type = STRING_RESULT;
}
return 0;
}
char* compress_protein_sequence(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* ret_length, char* is_null, char* error) {
unsigned long length = args->lengths;
//*** Checking on the arguments
*ret_length = (unsigned long) length;
if(!(result = malloc(sizeof(char) * ((*ret_length) + 1)))) {
*is_null = 1;
*error=1;
*ret_length = 0;
return 0;
}
if(initid->ptr) {
free(initid->ptr);
}
initid->ptr = result;
memset( result, '\0', *ret_length + 1 );
//*** Some logic
result[*ret_length] = '\0';
return result;
}
void compress_protein_sequence_deinit(UDF_INIT* initid) {
if( initid->ptr )
free( initid->ptr );
}
I compile the C code:
gcc -Wall -I/usr/local/include -shared -o libcompress_sequence.so -c compress_sequence.c
MySQL plugin directory is given by:
SHOW VARIABLES LIKE '%plugin%';
the answer is:
+---------------+------------------------+
| Variable_name | Value |
+---------------+------------------------+
| plugin_dir | /usr/lib/mysql/plugin/ |
+---------------+------------------------+
So I put the libcompress_sequence.so in the plugin folder of MySQL:
sudo cp libcompress_sequence.so /usr/lib/mysql/plugin/
I start MySQL in command line as root:
mysql -u root -p
I chose a database then I execute this MySQL command:
CREATE FUNCTION COMPRESS_PROTEIN_SEQUENCE RETURNS STRING SONAME 'libcompress_sequence.so';
and MySQL shows this error:
ERROR 1126 (HY000): Can't open shared library 'libcompress_sequence.so' (errno: 0 /usr/lib/mysql/plugin/libcompress_sequence.so: only ET_DYN and ET_EXEC can be loaded)
What is ET_DYN? What is ET_EXEC?
What is happening?
How to solve the problem?
Julien Ferté
(71 rep)
Oct 27, 2016, 02:37 PM
• Last activity: Oct 28, 2016, 09:53 AM
1
votes
0
answers
227
views
Add Shapefile loader plugin to PgAdminPortable
I'm using PgAdminPortable and I'd like to enable « PostGIS Shapefile and DBF loader » plugin. The issue is that the files are not structured as in a PostgreSQL complete install (see below). [![enter image description here][1]][1] I have tried the following steps: 1. Add the lines below (se...
I'm using PgAdminPortable and I'd like to enable « PostGIS Shapefile and DBF loader » plugin. The issue is that the files are not structured as in a PostgreSQL complete install (see below).
I have tried the following steps:
1. Add the lines below (see end of post) into

D:\PgAdminPortable\App\PgAdmin\plugins.d\pugins.ini
file. The plugin appears now correctly inside the plugins dropdown within pgAdmin, but when clicking it, I'm asked several DLLs files.
2. Create a postgisgui
folder within D:\PgAdminPortable\App\PgAdmin
.
3. Copy - paste missing DLLs files from a local PostgreSQL install into D:\PgAdminPortable\App\PgAdmin
(I have no bin
directory within PgAdminPortable folder). There are about 10 files missing. Once copied, I get a new error message saying that the program could not start...
----------
;
;PostGIS shp2pgsql-gui (Windows):
;
Title=PostGIS Shapefile and DBF loader
Command="$$PGBINDIR\postgisgui\shp2pgsql-gui.exe" -h "$$HOSTNAME" -p $$PORT -U "$$USERNAME" -d "$$DATABASE" -W "$$PASSWORD"
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR\postgisgui\shp2pgsql-gui.exe
Platform=windows
ServerType=postgresql
Database=Yes
SetPassword=Yes
wiltomap
(317 rep)
Jun 24, 2016, 08:19 AM
1
votes
1
answers
2388
views
SQL Server 2016 Plugin's not working
Recently I installed SQL Server 2016 on my PC. Here is the detailed information of my server : > Microsoft SQL Server 2016 (RC1) - 13.0.1200.242 (X64) > Mar 10 2016 16:49:45 > Copyright (c) Microsoft Corporation > Enterprise Evaluation Edition (64-bit) on Windows 10 Pro 6.3 (Build 10586: ) After ins...
Recently I installed SQL Server 2016 on my PC.
Here is the detailed information of my server :
> Microsoft SQL Server 2016 (RC1) - 13.0.1200.242 (X64)
> Mar 10 2016 16:49:45
> Copyright (c) Microsoft Corporation
> Enterprise Evaluation Edition (64-bit) on Windows 10 Pro 6.3 (Build 10586: )
After installing server on my PC then tried to install the below plugin's
1. SQL Pretty Printer Add-In for SSMS V3.6.1
2. SQLSentry Plan explorer
Problems:
1. **SQL Pretty Printer** does not even install it was throwing error like
But the **SQL Pretty Printer** site says it works on SQL Server 2016 you can check the link.
2. Next **SQLSentry Plan explorer** was installed successfully but the plugin was not showing up in
Can anyone help me out with this thing. Note both worked perfectly in SQL Server 2014.


SSMS
.
**Version:** v2.8 (Build 9.0.9252.0)

Pரதீப்
(1419 rep)
Apr 3, 2016, 04:33 AM
• Last activity: Apr 7, 2016, 08:58 AM
1
votes
1
answers
1183
views
Cannot connect to local db
I am in a Supply Chain Masters program and need to install the Excel Data Mining add-in for Excel. I downloaded and installed [Microsoft® SQL Server® 2012 SP1 Data Mining Add-ins for Microsoft® Office®][1]. This package includes two add-ins for Microsoft Office Excel (Table Analy...
I am in a Supply Chain Masters program and need to install the Excel Data Mining add-in for Excel. I downloaded and installed Microsoft® SQL Server® 2012 SP1 Data Mining Add-ins for Microsoft® Office® .
This package includes two add-ins for Microsoft Office Excel (Table Analysis Tools and Data Mining Client) and one add-in for Microsoft Office Visio 2010 (Data Mining Templates). The add-ins are supported on Office 2010 and Office 2013.
Once installed, I cannot connect to *localhost*. I run two separate accounts: an admin account and a regular account. I've tried starting the service and it doesn't work.
I've tried to uninstall and reinstall several times. Any help would be greatly appreciated.
dtattoli
(11 rep)
Mar 13, 2016, 01:28 AM
• Last activity: Mar 13, 2016, 04:47 AM
1
votes
1
answers
2245
views
Question on Oracle OEM version and plugin version upgrade
I have a OEM 12c (12.1.0.4) running in my setup in which I have registered over 70-80 databases. I see the plugin updates with versions of each target (Oracle database, MS-SQL, MySQL) and I have the downloaded the plugin updates as well. 1. My question is that can I update my plugin which is higher...
I have a OEM 12c (12.1.0.4) running in my setup in which I have registered over 70-80 databases. I see the plugin updates with versions of each target (Oracle database, MS-SQL, MySQL) and I have the downloaded the plugin updates as well.
1. My question is that can I update my plugin which is higher version than my OEM itself?
2. If yes, should I update my plugin one version at a time? Say, my deployed oracle database plugin version is 12.1.0.4 and available downloaded versions for the same I have is 12.1.0.6 and 12.1.0.7. So I should update the 6 release first and then the 7? Also how to go ahead with the update?
3. Are there upgrades for the OEM itself? from 12.1.0.4 to a higher version? If yes, how to go ahead with it? Are there any MOS if you could share?
Thanks!!
tesla747
(1910 rep)
Aug 31, 2015, 08:10 AM
• Last activity: Aug 31, 2015, 10:29 AM
Showing page 1 of 20 total questions