Has anyone switched over to MariaDB with links and are there any issues? Thanks!
Apr 24, 2017, 10:09 PM
Veteran / Moderator (18441 posts)
Apr 24, 2017, 10:09 PM
Post #2 of 13
Views: 5908
Does GLinks even support it? Can't say I've ever used it, but I do tend to stick with mySQL.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
May 1, 2017, 9:02 PM
Enthusiast (832 posts)
May 1, 2017, 9:02 PM
Post #3 of 13
Views: 5813
Quote:
but I do tend to stick with mySQL.
May 1, 2017, 10:26 PM
Veteran / Moderator (18441 posts)
May 1, 2017, 10:26 PM
Post #4 of 13
Views: 5775
Ah I wasn't aware they were stopping development of mySQL. I guess GT would need to comment on this, as I don't think it's even an option in the GT libs?
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Mar 11, 2024, 4:11 PM
User (434 posts)
Mar 11, 2024, 4:11 PM
Post #5 of 13
Views: 699
More or less a comment for myself or maybe someone reading this.
I am about to move to another server and I still don´t want to let go from LinksSQL.
It looks like MariaDB works more or less with LinksSQL.
I modified two things in MYSQL:.pm but the rest looks good for now.
+return $self->{sth}->{mariadb_insertid} || $self->{sth}->{insertid};
$connect->{host} ||= 'localhost';
$connect->{port} = undef if $connect->{host} eq 'localhost';#new MariaDB
$self->{driver} = $connect->{driver};
-$dsn = "DBI:$connect->{driver}:";
+$dsn = "DBI:$connect->{driver_to_connect}:";
This was a shortcut avoiding to make a MARIADB.pm file.
Regards
n||i||k||o
I am about to move to another server and I still don´t want to let go from LinksSQL.
It looks like MariaDB works more or less with LinksSQL.
I modified two things in MYSQL:.pm but the rest looks good for now.
Code:
-return $self->{sth}->{mysql_insertid} || $self->{sth}->{insertid}; +return $self->{sth}->{mariadb_insertid} || $self->{sth}->{insertid};
Code:
+$connect->{driver_to_connect} = 'MariaDB'; $connect->{host} ||= 'localhost';
$connect->{port} = undef if $connect->{host} eq 'localhost';#new MariaDB
$self->{driver} = $connect->{driver};
-$dsn = "DBI:$connect->{driver}:";
+$dsn = "DBI:$connect->{driver_to_connect}:";
This was a shortcut avoiding to make a MARIADB.pm file.
Regards
n||i||k||o
Mar 15, 2024, 1:35 AM
Veteran / Moderator (18441 posts)
Mar 15, 2024, 1:35 AM
Post #8 of 13
Views: 636
Hmm are you sure this is needed? I've been using MariaDB quite happily for ages, and can't say I've noticed any problems with it. It seems like mysql_insert_id is valid:
https://mariadb.com/kb/en/mysql_insert_id/
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
https://mariadb.com/kb/en/mysql_insert_id/
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Mar 15, 2024, 5:43 AM
User (434 posts)
Mar 15, 2024, 5:43 AM
Post #9 of 13
Views: 632
I got an error which made me investigate and try to solve it the above way.
I guess that maybe you work with a MariaDB database but use the. DBI:mysql driver.
The modification switches to DBI:MariaDB.
I had issues with special characters (Umlaute but also ndash and mdash) that probably won´t affect you.
The connection from the new server to the database of the GT server which I could solve by using:
in Driver.pm.
On the new server with the old data I came up with the DBI:MariaDB.
At the moment everything seems to work fine and I hope I did not mess everything up in long terms.
I guess that maybe you work with a MariaDB database but use the. DBI:mysql driver.
The modification switches to DBI:MariaDB.
I had issues with special characters (Umlaute but also ndash and mdash) that probably won´t affect you.
The connection from the new server to the database of the GT server which I could solve by using:
Code:
$CONN{$conn_key}->{mysql_enable_utf8} = 1;On the new server with the old data I came up with the DBI:MariaDB.
At the moment everything seems to work fine and I hope I did not mess everything up in long terms.
Mar 15, 2024, 6:24 AM
Veteran / Moderator (18441 posts)
Mar 15, 2024, 6:24 AM
Post #10 of 13
Views: 625
For UTF8, I just add this into GT::SQL::Driver::MYSQL.pm:
# -----------------------------------------------------------------------------
# Override connect to set up the connection character set for new MySQL's that
# have switched to using UTF-8 as the default.
#
my $self = shift;
# MySQL 5.5+ switches from using the compiled in default (usually latin1)
# to the system LANG/LC_ALL setting (which is typically UTF-8). Switch to
# using latin1 for backwards compatibility.
$self->{charset} ||= 'latin1';
#$self->{charset} ||= 'utf8';
my $initialized = $self->{dbh} ? 1 : 0;
my $dbh = $self->SUPER::connect($@);
if ($dbh and not $initialized and $self->{charset}) {
$self->debug("Setting up MySQL connection character set to: $self->{charset}") if $self->{_debug};
# $dbh->{mysql_enable_utf8} = 1 if lc $self->{charset} eq 'utf8';
# $dbh->do("SET NAMES '$self->{charset}'");
}
$dbh->{mysql_enable_utf8} = 1;
$dbh->do("SET NAMES 'utf8'");
return $dbh;
}
And also in GT::SQL::Table.pm
...
$self->do_query("SET NAMES 'utf8'");
$self->debug("Table '$self->{name}' object created.") if ($self->{_debug} > 2);
return $self;
}
That seems to work for me with MariaDB and UTF8 :)
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
sub connect { # -----------------------------------------------------------------------------
# Override connect to set up the connection character set for new MySQL's that
# have switched to using UTF-8 as the default.
#
my $self = shift;
# MySQL 5.5+ switches from using the compiled in default (usually latin1)
# to the system LANG/LC_ALL setting (which is typically UTF-8). Switch to
# using latin1 for backwards compatibility.
$self->{charset} ||= 'latin1';
#$self->{charset} ||= 'utf8';
my $initialized = $self->{dbh} ? 1 : 0;
my $dbh = $self->SUPER::connect($@);
if ($dbh and not $initialized and $self->{charset}) {
$self->debug("Setting up MySQL connection character set to: $self->{charset}") if $self->{_debug};
# $dbh->{mysql_enable_utf8} = 1 if lc $self->{charset} eq 'utf8';
# $dbh->do("SET NAMES '$self->{charset}'");
}
$dbh->{mysql_enable_utf8} = 1;
$dbh->do("SET NAMES 'utf8'");
return $dbh;
}
And also in GT::SQL::Table.pm
Code:
sub new { ...
$self->do_query("SET NAMES 'utf8'");
$self->debug("Table '$self->{name}' object created.") if ($self->{_debug} > 2);
return $self;
}
That seems to work for me with MariaDB and UTF8 :)
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Mar 15, 2024, 7:58 AM
Veteran / Moderator (18441 posts)
Mar 15, 2024, 7:58 AM
Post #12 of 13
Views: 614
Yeah, migrating an old setup to utf8 is a bit of a pain! I had to do a site conversion for someone recently, as we wanted to go "full utf8"... but it requires quite a lot of tweaks to existing tables (due to data lengths etc). Its worth it in the end though! (the templates were also a bit tricky to get working properly with utf8 versions)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Mar 16, 2024, 2:34 PM
User (434 posts)
Mar 16, 2024, 2:34 PM
Post #13 of 13
Views: 582
Hope you are still around when the day of utf8 comes for me.
Kind of miss the old GT staff and the spirit of the company.
I am a little wistful today, just removed all my remaining data from the good old GT server in UK.
The last link to the original Links ... besides this forum and the last couple of people hanging out here.
Kind of miss the old GT staff and the spirit of the company.
I am a little wistful today, just removed all my remaining data from the good old GT server in UK.
The last link to the original Links ... besides this forum and the last couple of people hanging out here.