Package Details: mysql-clients 9.0.1-1

Git Clone URL: https://aur.archlinux.org/mysql.git (read-only, click to copy)
Package Base: mysql
Description: MySQL client tools
Upstream URL: https://www.mysql.com/products/community/
Licenses: GPL-2.0-only
Conflicts: mariadb-clients
Provides: mariadb-clients, mysql-clients
Submitter: Barthalion
Maintainer: Muflone
Last Packager: Muflone
Votes: 82
Popularity: 0.034019
First Submitted: 2013-04-25 19:13 (UTC)
Last Updated: 2024-08-11 14:51 (UTC)

Required by (21)

Sources (8)

Pinned Comments

Muflone commented on 2023-08-16 17:21 (UTC) (edited on 2023-08-16 20:41 (UTC) by Muflone)

Warning

https://dev.mysql.com/doc/refman/8.1/en/downgrading.html

Downgrade from MySQL 8.1 to MySQL 8.0 or earlier is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you back up your data before starting the upgrade process.

MySQL 8.0 is available in https://aur.archlinux.org/packages/mysql80

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 .. 19 Next › Last »

fishnet37222 commented on 2021-05-27 13:31 (UTC)

Will this package be updated to version 8.0.25 any time soon?

Muflone commented on 2021-05-02 02:04 (UTC)

@hxss fixed

Moved users management from .install to systemd-sysusers. After package uninstall the existing mysql and mysqlrouter users will not be deleted automatically

hxss commented on 2021-04-21 07:26 (UTC)

Post-transaction hook requires mysqlrouter user that doesn't exists in my system after installing the package.

:: Processing package changes...
(1/3) reinstalling libmysqlclient                                         [#########################################] 100%
(2/3) reinstalling mysql-clients                                          [#########################################] 100%
(3/3) reinstalling mysql                                                  [#########################################] 100%
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Creating temporary files...
/usr/lib/tmpfiles.d/mysqlrouter.conf:23: Failed to resolve user 'mysqlrouter': No such process
/usr/lib/tmpfiles.d/mysqlrouter.conf:24: Failed to resolve user 'mysqlrouter': No such process
/usr/lib/tmpfiles.d/mysqlrouter.conf:25: Failed to resolve user 'mysqlrouter': No such process
error: command failed to execute correctly
(3/3) Arming ConditionNeedsUpdate...

AnotherUser commented on 2021-02-10 07:35 (UTC) (edited on 2021-02-10 07:52 (UTC) by AnotherUser)

I tried to install mysql with mariadb-clients as provider for mysql-clients:

:: There are 2 providers available for mysql-clients:
:: Repositoryextra
    1) mariadb-clients :: Repositorycommunity
    2) percona-server-clients 

Enter a number (default=1):

Which leads to:

error: failed to commit transaction (conflicting files)
mysql: /usr/bin/mysql_upgrade exists in filesystem (owned by mariadb-clients)
mysql: /usr/bin/mysqlbinlog exists in filesystem (owned by mariadb-clients)
mysql: /usr/bin/mysqltest exists in filesystem (owned by mariadb-clients)
mysql: /usr/share/man/man1/mysql_upgrade.1.gz exists in filesystem (owned by mariadb-clients)
mysql: /usr/share/man/man1/mysqlbinlog.1.gz exists in filesystem (owned by mariadb-clients)
Errors occurred, no packages were upgraded.

I'm confused

Edit: I just removed the existing mariadb libs (without dependency check):

yay -ddR mariadb-libs

and installed the mysql-clients with libmysqlclient. After that it was possible to install mysql..

Is there a better approach?

postfix needs mariadb-libs

cidao commented on 2021-01-22 03:30 (UTC)

I think there are some incompatibilities between the last Manjaro update and this MySQL package. Do you know when it can be fixed?

Muflone commented on 2021-01-10 02:59 (UTC)

Incorporated FrederickZh's fixes, Thank you

cascooscuro commented on 2021-01-03 17:28 (UTC)

I'm also facing the error "TRUE was not declared in this scope" while compiling.

I added: export CXXFLAGS="${CXXFLAGS} -DU_DEFINE_FALSE_AND_TRUE=1"

before the:

cmake "../${pkgbase}-${pkgver}"

and now the compilation finishes

petronny commented on 2020-12-27 06:09 (UTC)

Please add FrederickZh's patch.

FrederickZh commented on 2020-12-25 11:46 (UTC)

And for some reason I now need to patch mysqld.cc otherwise it won't compile (TRUE was not declared in this scope):

diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 51992613..0dc0c7c4 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -925,8 +925,9 @@ using std::min;
 using std::vector;

 #define mysqld_charset &my_charset_latin1
 #define mysqld_default_locale_name "en_US"
+#define TRUE (1)

 #ifdef HAVE_FPU_CONTROL_H
 #include <fpu_control.h>  // IWYU pragma: keep
 #elif defined(__i386__)

This happens under my two Arch systems as well as a clean chroot.

FrederickZh commented on 2020-12-25 11:39 (UTC) (edited on 2020-12-25 11:41 (UTC) by FrederickZh)

I don't use MySQL Router, but an error during post-upgrade caught my eye:

(2/5) Creating temporary files...
/usr/lib/tmpfiles.d/mysqlrouter.conf:23: Path 'run' not absolute.
error: command failed to execute correctly

And after digging deeper, I noticed that the default directories used by MySQL Router are obviously off as well:

$ mysqlrouter --help
MySQL Router  Ver 8.0.22 for Linux on x86_64 (Source distribution)
Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Configuration read from the following files in the given order (enclosed
in parentheses means not available for reading):
  (/usr/bin/.././mysqlrouter.conf)
  (/usr/bin/.././mysqlrouter.ini)
  (/home/frederick/.mysqlrouter.conf)
  (/home/frederick/.mysqlrouter.ini)
Plugins Path:
  /usr/lib/mysqlrouter

Default Log Directory:
  /usr

Default Persistent Data Directory:
  /usr/bin/../var/lib/mysqlrouter

Default Runtime State Directory:
  /usr/bin/../run

Here's a patch I've come up with (without .SRCINFO):

diff --git a/PKGBUILD b/PKGBUILD
index 4d305fe..9d11faa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -25,9 +25,9 @@ sha256sums=('ba765f74367c638d7cd1c546c05c14382fd997669bcd9680278e907f8d7eb484'
             '6bc24ae510f6b6bbad6b3edda2d0028b29292937b482274a4c2fae335f4de328'
             'e1c23fa0971a13d998f2790379b68c475438d05b6d6f2691b99051dbf497567f'
             '203dcd22fea668477ac7123dbd9909fae72d3d07f8855417a669a9c94db072ae'
             '8fbedfc2c5fe271ed13217feeceeac00202d2cb135e4283eeee2f9a13d6251af'
-            '7dfc863de8ba62b31e412bdb82a2617c90b9e588db34028ab694813547dab167')
+            '0c047b18b9d40cae66be6d234d655347ee84d36420c8d70dc07334b6c960d9c7')

 build() {
   rm -rf build
   mkdir build
@@ -52,8 +52,12 @@ build() {
     -DINSTALL_SUPPORTFILESDIR=share/mysql \
     -DINSTALL_MYSQLSHAREDIR=share/mysql \
     -DINSTALL_DOCDIR=share/mysql/docs \
     -DINSTALL_SHAREDIR=share/mysql \
+    -DROUTER_INSTALL_CONFIGDIR=../etc/mysqlrouter \
+    -DROUTER_INSTALL_DATADIR=../var/lib/mysqlrouter \
+    -DROUTER_INSTALL_RUNTIMEDIR=../run \
+    -DROUTER_INSTALL_LOGDIR=../var/log/mysqlrouter \
     -DWITH_SYSTEM_LIBS=ON \
     -DWITH_SSL=system \
     -DWITH_LIBWRAP=OFF \
     -DWITH_LTO=ON \
@@ -135,8 +139,9 @@ package_mysql-clients(){

 package_mysql(){
   pkgdesc="Fast SQL database server, community edition"
   backup=("etc/mysql/my.cnf"
+          "etc/mysqlrouter/mysqlrouter.conf"
           "etc/conf.d/${pkgname}.conf")
   install="${pkgbase}.install"
   depends=('mysql-clients' 'libsasl' 'zlib' 'jemalloc' 'libaio' 'libtirpc' 'icu'
            'lz4' 'libevent' 'systemd-libs')
@@ -150,8 +155,9 @@ package_mysql(){

   install -m 644 -D "${srcdir}/my-default.cnf" "${pkgdir}/etc/mysql/my.cnf"
   install -m 755 -d "${pkgdir}/etc/ld.so.conf.d"
   install -m 644 -D "${srcdir}/mysql-ld.so.conf" "${pkgdir}/etc/ld.so.conf.d/${pkgname}.conf"
+  install -m 644 -D "${srcdir}/build/packaging/rpm-common/mysqlrouter.conf" "${pkgdir}/etc/mysqlrouter/mysqlrouter.conf"

   # provided by libmysqlclient
   rm "${pkgdir}/usr/bin/mysql_config"
   rm "${pkgdir}/usr/lib/libmysqlclient.a"
@@ -187,9 +193,9 @@ package_mysql(){
   rm "${pkgdir}/usr/share/man/man1/mysqlslap.1"

   # not needed
   rm -r "${pkgdir}/usr/mysql-test"
-  rmdir "${pkgdir}/usr/run"
+  rmdir "${pkgdir}/run"

   # Move somewhere else
   mv "${pkgdir}/usr/LICENSE.router" "${pkgdir}/usr/share/mysql/docs"
   mv "${pkgdir}/usr/README.router" "${pkgdir}/usr/share/mysql/docs"
@@ -206,11 +212,13 @@ package_mysql(){

   # Cleanup
   rmdir "${pkgdir}/usr/usr/lib"
   rmdir "${pkgdir}/usr/usr"
-  rmdir "${pkgdir}/usr/var/lib/mysqlrouter"
-  rmdir "${pkgdir}/usr/var/lib"
-  rmdir "${pkgdir}/usr/var"
+  rmdir "${pkgdir}/var/lib/mysqlrouter"
+  rmdir "${pkgdir}/var/lib"
+  rmdir "${pkgdir}/var/log/mysqlrouter"
+  rmdir "${pkgdir}/var/log"
+  rmdir "${pkgdir}/var"

   # Arch Linux specific patches:
   #  * enable PrivateTmp for a little bit more security
   #  * force preloading jemalloc for memory management
diff --git a/mysql.install b/mysql.install
index 90583a1..384c764 100644
--- a/mysql.install
+++ b/mysql.install
@@ -6,8 +6,16 @@ post_install(){
     install -dm700 "/var/lib/mysql"
     chown -R mysql:mysql "/var/lib/mysql" &>/dev/null
   fi

+  groupadd -g 88 mysqlrouter &>/dev/null
+  useradd -u 88 -g mysqlrouter -d "/var/lib/mysqlrouter" -s /bin/false mysqlrouter &>/dev/null
+
+  if [[ ! -e "/var/lib/mysqlrouter" ]]; then
+    install -dm700 "/var/lib/mysqlrouter"
+    chown -R mysqlrouter:mysqlrouter "/var/lib/mysqlrouter" &>/dev/null
+  fi
+
   echo ":: You need to initialize the MySQL data directory prior to starting"
   echo "   the service. This can be done with mysqld --initialize command, e.g.:"
   echo "   mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
   echo ":: Additionally you should secure your MySQL installation using"
@@ -20,5 +28,11 @@ post_remove(){
   fi
   if getent group mysql >/dev/null 2>&1; then
     groupdel mysql
   fi
+  if getent passwd mysqlrouter >/dev/null 2>&1; then
+    userdel mysqlrouter
+  fi
+  if getent group mysqlrouter >/dev/null 2>&1; then
+    groupdel mysqlrouter
+  fi
 }
diff --git a/systemd-sysusers-tmpfiles.patch b/systemd-sysusers-tmpfiles.patch
index 6eccab1..ea21328 100644
--- a/systemd-sysusers-tmpfiles.patch
+++ b/systemd-sysusers-tmpfiles.patch
@@ -7,4 +7,14 @@
 -d /var/run/mysqld 0755 mysql mysql  -
 +d /run/mysqld 0755 mysql mysql  -
 +d /var/lib/mysql 0700 mysql mysql  -

+--- a/usr/lib/tmpfiles.d/mysqlrouter.conf  2020-12-25 21:41:47.218202248 +1100
++++ b/usr/lib/tmpfiles.d/mysqlrouter.conf  2020-12-25 21:42:07.126124043 +1100
+@@ -20,4 +20,6 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+ 
+-d ../run 0755 mysqlrouter mysqlrouter  -
++d /run/mysqlrouter 0755 mysqlrouter mysqlrouter  -
++d /var/lib/mysqlrouter 0700 mysqlrouter mysqlrouter  -
++d /var/log/mysqlrouter 0750 mysqlrouter mysqlrouter  -

tl;dr this patch:

  1. creates mysqlrouter user & group during post-install
  2. fixes the post-upgrade problem above
  3. creates /var/lib/mysqlrouter & /var/log/mysqlrouter via systemd-tmpfiles
  4. copies the default Router configuration to /etc/mysqlrouter/mysqlrouter.conf

Btw now mysqlrouter --help output becomes:

Configuration read from the following files in the given order (enclosed
in parentheses means not available for reading):
  /etc/mysqlrouter/mysqlrouter.conf
  (/etc/mysqlrouter/mysqlrouter.ini)
  (/home/frederick/.mysqlrouter.conf)
  (/home/frederick/.mysqlrouter.ini)
Plugins Path:
  /usr/lib/mysqlrouter

Default Log Directory:
  /var/log/mysqlrouter

Default Persistent Data Directory:
  /var/lib/mysqlrouter

Default Runtime State Directory:
  /run

PS: this might be useful https://koji.mbox.centos.org/pkgs/packages/mysql/8.0.21/1.module_el8.2.0+493+63b41e36/data/logs/x86_64/build.log