Have you ensured that mariadb is running when you're trying to run these
commands?
This is also something you should be doing with *some* sort of
configuration management--not a post install script.
Lachlan Musicman <mailto:data...@gmail.com>
Wednesday, March 30, 2016 1:55 AM
In one particular profile, I'll be installing MariaDB.
I'd like to create a db, user, and then secure MariaDB during the
post-install stage.
My post install script looks like this:
%post --log /root/ks-post.log.5
#!/bin/bash
/usr/bin/mysql -e "create database slurmdb; grant all privileges on
slurmdb.* to slurm@localhost identified by 'slurmdb_password';"
/usr/bin/mysql <<-EOF
UPDATE mysql.user SET Password=PASSWORD('mysqlpassword') WHERE
User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost',
'127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%';
FLUSH PRIVILEGES;
EOF
%end
But it's not working - neither the database being created or mysql
being secured.
Is my syntax wrong, am I over reaching?
L.
------
The most dangerous phrase in the language is, "We've always done it
this way."
- Grace Hopper
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
--
Sent from Postbox
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list