Default user: WSO2 Identity Server with Mariadb - mariadb

I followed the steps defined in this link and restarted the WSO2 identity server.
When trying to login at https://localhost:9443/carbon using admin/admin credentials, it's giving me login failed message. Before changing the settings for WSO2, it was working with this credentials.
Obviously, that user is not present in MariaDB. Does anyone has any scripts to insert an admin user in WSO2 Maria DB for? I don't know what all tables I need to update in case of adding user manually. Or is there any other default user?
Kindly suggest.

Had the same problem, even switched to mysql community and it didn't fix it.
So with mysql installed I did the following, after MANY tries,
mysql -u root -p
create DATABASE regdb;
exit;
mysql -u root -p regdb < <WSO2_HOME>/dbscripts/mysql5.7.sql
mysql -u root -p regdb < <WSO2_HOME>/dbscripts/identity/mysql-5.7.sql
nohup <WSO2_HOME>/bin/wso2server.h -Dsetup &
If there is someplace to see the DB version, I haven't found it, but this got it all to working form me. So loading keep failing the DB because of some default time functions in the sql.
My $0.02

Related

Access denied after Mariadb version upgrade

I upgraded my mariadb from 10.1 to 10.9 pointing to same data directory (checked ownership of files also). But when I try to access the mysql instance with existing users from different hosts (which used to work before upgrade), I get:
mysql --host <hostname> --port <port> -uusername -p<pwd>
ERROR 1045 (28000): Access denied for user 'username'#'ip' (using password: YES)
I tried flushing privileges & reloading mysql but nothing worked.
When I see the user * db information in mysql.user & mysql.db tables, everything is same pre & post upgrade.
Though I am able to remotely access mysql using root user. But other user don't work.
Also there are some users which are created as a part of init script (used in --init-file={} while starting up mariadb), I am not able to access using those users also. Only root user is working.
Please help what can be the problem.
Thanks In advance.

create cluster for existing mariadb database

I have an existing database for which i was looking to create a new clustered environment. I tried the following steps:
Create a new database instance (OS & DB Server).
Take a backup / snapshot from existing database server for all the databases.
Import the snapshot to the new server.
Configure the cluster - referred to various sites but all giving same solution. Example reference site - https://vexxhost.com/resources/tutorials/how-to-configure-a-galera-cluster-with-mariadb-on-ubuntu-12-04/
Ran the command (sudo galera_new_cluster) on the primary server. (Primary server - no issue starting up). But when we tried starting the secondary server - it actually crashed for some reason.
Unfortunately at this point, dont have the logs stored / backed up with me where it failed. But it seemed like it tried to sync in with the primary server - had some failure with that.
As for additional part of the actions performed above. Both the server with same username / password - created a passwordless ssh connection between both the machines. Also, the method of syncing is set to rsync.
Am i missing something or doing it wrong? Is there a better way available on it?

MariaDB: error 1045 when doing GRANT ALL

I'm hoping that someone can help me here. With Centos 7 all the install docs I have found said to use MariaDB instead of mysql which is fine, but I can't seem to enable remote access.I have used the "GRANT ALL ON . to user#'address' IDENTIFIED BY 'your-root-password';" and flushed privileges and restarted the service. I still am not able to connect via remote terminal I get ERROR 1045 (28000): Access denied for user username.
So I found another article that said I should go to my my.cnf file and make sure my bind settings are set correctly and such.
https://mariadb.com/kb/en/mariadb/documentation/getting-started/configuring-mariadb-for-remote-client-access/
Based on what this article shows my my.cnf file is completely different than what it should be. Doesn't contain bind-address or skip-networking or port or anything. It looks like the below.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
I was wondering if anyone else might know what's going on with this. Thanks.
You may want to investigate this link:
http://www.versatilewebsolutions.com/blog/2015/05/dealing-with-mariadb-plugin-unixsocket-is-not-loaded.html
Essentially, MariaDB switched to unix_socket authentication as a default authentication plugin. To get around it, connect to your MariaDB server and execute these queries:
USE mysql;
UPDATE user SET plugin='' WHERE User = 'root';
FLUSH PRIVILEGES;
exit
This will disable socket authentication and switch back to standard authentication. I do not think this is recommended for production.

Eucalyptus 3.4.2 CentOS 6 demo root password

I installed cloud-in-a-box/fastrack of Eucalyptus and am able to create instance and log into it. But when trying sudo, sudo su - or login in as root I'm asked for a password. I'm not sure what the password might be. Does anyone know what the default password for the Image is?
I think this is how the image is designed. It uses the cloud-user account only and has no root access, nor does it allow sudo.
There are other starter images available that can be "installed" that have sudo as root enabled. In those cases you simply issue
sudo su -
and you become root.
To see what is easily available use:
eustore-describe-images
As a note, some of the other starter images have different accounts (not cloud-user), such as ec2-user. If you don't know which account to use simply try to ssh into the instance as root and it will usually get a message back telling you:
Please login as the user "ec2-user" rather than the user "root".
I am not sure if there is a password on the root account in that image. Regardless, the recommended way to log into instances is by creating an SSH key (euca-create-keypair KEYNAME >KEYNAME.pem), specifying it when running an instance (euca-run-instance -k KEYNAME), and then logging in using the key generated (ssh -i KEYNAME.pem root#INSTANCE-IP). You'll probably have to change the permissions on that .pem file before SSH will allows you to use it (chmod 0600 KEYNAME.pem). The instance obtains the public portion of the key from the cloud at boot time and adds it to the authorized_keys file.

Execute command in ubuntu terminal from an aspnet application

I have a command to drop postgresql database:
sudo -u myuser psql -c "drop database my_databse"
How I could execute this sentence from an aspnet website(c#)?
Is it possible to execute without introducing a password?
This app is running in another server:
I have a windows server running aspnet website.
I have an ubuntu server running postgresql database.
drop database my_databse is an SQL command. You can run it directly from nPgSQL. There is no need to run psql, and no point doing so.
If your usual user account doesn't have the access rights for it, you can make a new temporary connection in nPgSQL just for that command. You might find SET SESSION AUTHORIZATION or SET ROLE useful, too.

Resources