Giter Club home page Giter Club logo

Comments (2)

jessuppi avatar jessuppi commented on July 22, 2024 1

Wow thanks mate, appreciate that.

I'm copy pasting your code snippet below for reference:

systemctl enable mariadb
systemctl start mariadb
#mysql_secure_ins-whatever is a garbage script
#run the same commands it does, but without an expect wrapper
#this is a cloud cattle car, not a multiuser system
export PASS=MYVAL
mysql -uroot -e "UPDATE mysql.user SET Password=PASSWORD('$PASS') WHERE User='root';"
mysql -uroot -p$PASS -e "FLUSH PRIVILEGES;"
mysql -uroot -p$PASS -e "DELETE FROM mysql.user WHERE User='';"
mysql -uroot -p$PASS -e "DROP DATABASE IF EXISTS test;"
mysql -uroot -p$PASS -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
mysql -uroot -p$PASS -e "FLUSH PRIVILEGES;"
#this disabled everything but remove root login, which in a private VPC you might want on
#but here's the part that does it, ripped out of that script 
#mysql -uroot -p$PASS -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
#mysql -uroot -p$PASS -e "FLUSH PRIVILEGES;"

Yah I hate the expect approach too, but didn't know of a better method... MySQL in general seems to present various challenges in Bash scripting.

Will review this, thanks :)

from slickstack.

jessuppi avatar jessuppi commented on July 22, 2024

We are no longer using expect or janky guess-and-check for MySQL installation, which is now in it's own script. Although it's still being perfected, interested users can review the script here:

https://github.com/littlebizzy/slickstack/blob/master/ss-install-mysql.txt

It is now included as part of the ss-install process.

The focus is now on supporting MySQL 8.0.x and accompanying challenges like password validation, auth_socket etc.

from slickstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.