• Creating a user mysql database in a specific dir

    From Paulo da Silva@21:1/5 to All on Fri Feb 4 21:56:11 2022
    Hi!

    How can I create a mysql database for a regular user placed at a given dir?

    I am using kubuntu 20.04.

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan N. Little@21:1/5 to Paulo da Silva on Fri Feb 4 17:42:50 2022
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a given dir?

    I am using kubuntu 20.04.

    Thanks.

    I believe you can make a user config

    ~/.my.cnf

    then set

    datadir = /wherever/you/want

    You might have to launch the service in the user session, never done
    this, someone else might jump in for more info...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paulo da Silva@21:1/5 to All on Sat Feb 5 01:55:21 2022
    Às 22:42 de 04/02/22, Jonathan N. Little escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a given dir? >>
    I am using kubuntu 20.04.

    Thanks.

    I believe you can make a user config

    ~/.my.cnf

    then set

    datadir = /wherever/you/want

    But that changes the data dir for all dbs. It would break the dbs from
    the preinstalled services that came with the distro.
    I have searched the net and it seems that it is not possible. Only with
    a VM or docker or anything alike.

    Thanks anyway.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Purgert@21:1/5 to Paulo da Silva on Sat Feb 5 02:57:34 2022
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512

    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a given dir?

    You don't, at least not "specifically".

    What're you actually trying to accomplish? Giving them limited access
    into the database schema(s) or something?

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmH958cACgkQbWVw5Uzn KGAUBQ//Z1K3M4eidc37jEOEVa879bmNOSAeeWbvlHGfYxJF7QsXPABkQOGk2Sr8 w5NWGTmIHzb/xx1vL2iXl6tQAwBiyrHWSRpG6r90JjsJmmP/So8RmGPmzGR2fAQY GpviUe1cCqd53aLvJ3yzZvX20VJRZ8QSSLMgfjMoQPsDAS1FuAD+L3JbVhW1CT3f YAIZ0nCMs6zwv6v3lBPswwynZ38sw3MElAyRKqM7jfUVOCsDhCac+BrcBGb9FXYv h1Qkm3dVh6HX2gTqPM1889kDnSCrmlx8mPQqio68ufeGMS4zYd11h7jKXz1C6fEU cTG+3D2Y8dBH7crc6GbWfbZ8Vzy1wQHKAr34V0b6XuIoyhr0FZhuTNYASbVMfM8d 1UY7+1PcezHWp5n0oQtf7EAVQRCmEleJTpfR5K2zKUkuNu8UNcqjiAt08ljqgrpI RHd2IxD+wbFTrXDFqerBkwVXFBMxd5pChN5Z9tM07fWcvAkLVHLvjwIqlvGXF8DL DE60Ll9zg1WUteSN9mlJsMK7+EKlJPMP/xSi3g71Nr2Xn0cjza5Mvy+D1uGVzNRn oXEtIuOeBCjkOw6oTc4zZmT9yrGOW0UxlQB/DMHXxDgmP6VH3653VTUoXI5qiN9P NkbirG81mWBilXzFExzHXVhS/EaYExVh+DKAJISogYNSiG8B4Z8=
    =kT5X
    -----END PGP SIGNATURE-----

    --
    |_|O|_| Github: https://github.com/dpurgert
    |_|_|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860
    |O|O|O|

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan N. Little@21:1/5 to Paulo da Silva on Fri Feb 4 22:19:06 2022
    Paulo da Silva wrote:
    Às 22:42 de 04/02/22, Jonathan N. Little escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a
    given dir?

    I am using kubuntu 20.04.

    Thanks.

    I believe you can make a user config

    ~/.my.cnf

    then set

    datadir =  /wherever/you/want

    But that changes the data dir for all dbs. It would break the dbs from
    the preinstalled services that came with the distro.
    I have searched the net and it seems that it is not possible. Only with
    a VM or docker or anything alike.

    Thanks anyway.

    Why would you want to in the first place? As a user you don't actually
    interact directly with the database files *frm *myd & *.myi. You
    interact via the service and you can give access to a specific database
    with permissions defined for your user in the mysql database. If is for something like backups then grant permissions SELECT, LOCK TABLES, SHOW
    VIEW, RELOAD for that user for that database...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paulo da Silva@21:1/5 to All on Sat Feb 5 04:17:58 2022
    Às 02:57 de 05/02/22, Dan Purgert escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a given dir?

    You don't, at least not "specifically".

    What're you actually trying to accomplish? Giving them limited access
    into the database schema(s) or something?



    Just create a big table to play with.
    I am developing a python script that needs a sql database. So far I'm
    using sqlite3 but in future I need to make it work with other sql dbs.
    It needs to have more than 2 billions rows at least to check for
    performance algorithms, for ex.
    ... and I don't want to mess up with the preinstalled dbs that came with
    the distro.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paulo da Silva@21:1/5 to All on Sat Feb 5 04:18:49 2022
    Às 03:19 de 05/02/22, Jonathan N. Little escreveu:
    Paulo da Silva wrote:
    Às 22:42 de 04/02/22, Jonathan N. Little escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a
    given dir?

    I am using kubuntu 20.04.

    Thanks.

    I believe you can make a user config

    ~/.my.cnf

    then set

    datadir =  /wherever/you/want

    But that changes the data dir for all dbs. It would break the dbs from
    the preinstalled services that came with the distro.
    I have searched the net and it seems that it is not possible. Only with
    a VM or docker or anything alike.

    Thanks anyway.

    Why would you want to in the first place? As a user you don't actually interact directly with the database files *frm *myd & *.myi. You
    interact via the service and you can give access to a specific database
    with permissions defined for your user in the mysql database. If is for something like backups then grant permissions SELECT, LOCK TABLES, SHOW
    VIEW, RELOAD for that user for that database...


    Please see my other post.
    Thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan N. Little@21:1/5 to Paulo da Silva on Fri Feb 4 23:32:29 2022
    Paulo da Silva wrote:
    Às 02:57 de 05/02/22, Dan Purgert escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a
    given dir?

    You don't, at least not "specifically".

    What're you actually trying to accomplish? Giving them limited access
    into the database schema(s) or something?



    Just create a big table to play with.
    I am developing a python script that needs a sql database. So far I'm
    using sqlite3 but in future I need to make it work with other sql dbs.
    It needs to have more than 2 billions rows at least to check for
    performance algorithms, for ex.
    ... and I don't want to mess up with the preinstalled dbs that came with
    the distro.


    What preinstalled dbs? The only one preinstalled in the mysql which
    holds the server level settings. Create your db and it is stored in its
    own db files... if you are not accessing that db then it has no impact
    on the performance any others on the system.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paulo da Silva@21:1/5 to All on Sat Feb 5 19:22:00 2022
    Às 04:32 de 05/02/22, Jonathan N. Little escreveu:
    Paulo da Silva wrote:
    Às 02:57 de 05/02/22, Dan Purgert escreveu:
    Paulo da Silva wrote:
    Hi!

    How can I create a mysql database for a regular user placed at a
    given dir?

    You don't, at least not "specifically".

    What're you actually trying to accomplish? Giving them limited access
    into the database schema(s) or something?



    Just create a big table to play with.
    I am developing a python script that needs a sql database. So far I'm
    using sqlite3 but in future I need to make it work with other sql dbs.
    It needs to have more than 2 billions rows at least to check for
    performance algorithms, for ex.
    ... and I don't want to mess up with the preinstalled dbs that came with
    the distro.


    What preinstalled dbs? The only one preinstalled in the mysql which
    holds the server level settings. Create your db and it is stored in its
    own db files... if you are not accessing that db then it has no impact
    on the performance any others on the system.

    You are right. I am playing with a VM and mysql doesn't come
    preinstalled. In my "real" system mariadb is installed certainly
    requested by one or more applications I installed.
    I have to move the dbs dir to another place (an external disk) - I need
    a lot of space.
    This is a problem for the pre existent dbs.
    So:
    - Is there a way to run a new instance, of mariadb for ex.? How?
    - May I install mysql after mariadb? I don't think so. Installed mariadb
    seems to share some stuff with mysql.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan N. Little@21:1/5 to Paulo da Silva on Sat Feb 5 17:03:09 2022
    Paulo da Silva wrote:
    - Is there a way to run a new instance, of mariadb for ex.? How?

    GOOGLE: <https://ubiq.co/database-blog/how-to-run-multiple-mysql-instances-on-same-machine/>

    - May I install mysql after mariadb? I don't think so. Installed mariadb seems to share some stuff with mysql.

    I am pretty sure you cannot as well. I also use MariaDB after MySql 8
    broke everything...


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paulo da Silva@21:1/5 to All on Sun Feb 6 21:18:19 2022
    Às 21:56 de 04/02/22, Paulo da Silva escreveu:
    Hi!

    How can I create a mysql database for a regular user placed at a given dir?

    I am using kubuntu 20.04.

    Thanks.

    Need to install mariadb-client and mariadb-server and use the command
    mariadb instead of mysql.

    To change the dir:
    1. Locate the service
    systemctl list-units |grep -i maria
    2. Stop it. systemctl stop mariadb.service
    3. Create a newdir (foo) and copy /var/lib/mysql CONTENTS to inside foo.
    4. Change ownership of foo. chown mysql:mysql foo
    5. Change the file /etc/mysql/mariadb.conf.d/50-server.cnf
    datadir=foo
    6. Start the service. systemctl start mariadb.service
    Replace foo for the full pathname of the new dir.

    That's all.
    Thanks for your attention.
    Paulo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)