How to configure node-mysql? - user-interface

I've found a lot of tutorials explaining how to install "node-mysql" (basically: "npm install mysql" and that's it) and others explaining how to make queries but nothing in-between.
I mean: with no GUI, how do you configure node-mysql (Mysql login, Mysql password, first table,..) before using it?
OR: How to install a GUI to access node-mysql for edition (which would solve problem 1)?
I tried "Mysql Workbench" via its wizard but I get a "Cannot connect to Database Server" while the host and the port are ok. I searched the "MySQL Workbench" website but there's nothing about node-mysql.
Node-Mysql seems to be the first choice when it comes to use mysql with node.js but, surprisingly, there's absolutely nothing about my issues, anywhere.
Thank you for your help.

you don't need to configure node-mysql itself, you need to learn how to add users to mysql database.
if you already have existing user, node-mysql client is very straightforward to use:
var client = mysql.createClient({
user: 'someusername',
password: 'somepassword',
});

Related

Start mySQL Server out of a Ruby program

I have a Linux server where I start a few Ruby programs during the day. The server is directly connected to the internet (no firewall) at a hoster and I wonder, if there is a way to start and close the mySQL server just before I update the db and close it afterwards. The target is, to have the mySQL server only open when it is needed. So I thought it might be a way to activate the port or the service directly out of Ruby.
thank you for answering,
Werner
You'd probably have to change the permissions to the database through ruby, then, doing whatever you want to do, and change the permissions back.
You could do that usig the mysql gem, connecting to the database and running the commands.
Then restart the process, and do the same thing but backwards
Honestly, I don't know why you would do that, and I wouldn't recommend someone to do that. But that would be my approach

H2O Steam deploy can't connect to Prediction Service Builder

I am trying to use h2o steam (running on localhost) to deploy a model. After importing the model from h2o flow, clicking the "deploy model" option in the "models" section of the project, filling out the resulting dialog box, and clicking the "deploy" button, the following messages are displayed:
At first I thought that it was because maybe I needed to start up the service builder on my own, so I started it up following the docs here, but still got the same error. Any suggestions would be appreciated. Thanks :)
Just make sure jetty HTTP server is running locally by executing the following in your shell:
java -jar var/master/assets/jetty-runner.jar var/master/assets/ROOT.war
Looking here, it seems like I would need to "override" some kind of default browser restriction for accessing localhost:8080 (which is what I assume steam is trying to do to launch the service builder (I don't know much about networking related stuff)). I got around this by launching steam with the command:
$ ./steam serve master --prediction-service-host=localhost --prediction-service-port-range=12345:22345
where the ports are some arbitrary range between (1025, 65535) which I got by word-searching the a page of the steam source code (line 182 as of the date of this posting).
Doing this lets me deploy the models through the steam dialog without any error messages. Again, I don't know much about networking related stuff, so if anyone has a better way to solve this problem (ie. allow access of localhost:8080) please post or comment. Thanks.

psql password authentication failed for user on mac with no "pg_hba.conf"

i am really super frustrated/lost so I would appreciate any help I can get here. I have searched all over Google and SO and it seems nobody has had my problem yet.
Symptom: when i try to run psql in command line, or connect to any GUI postgresql client like Postgres or Postico, I get errors like FATAL: password authentication failed for user <myusername>. It asks me for my username where it shouldn't ask for one.
All the advice online goes along the lines of "find your pg_hba.conf file and add these magic lines to it", but here's the thing: I don't have a pg_hba.conf file! The normal location (on a Mac) seems to be in /etc/postgresql (like this) and this folder just plain doesnt exist on my mac even though I have installed all the other postgresql paraphernalia.
There's a remote possibility that my pg_hba.conf is in some other location but guess what! i need a running psql instance to find it! whoop-dee-heckin-do chicken and egg!
I notice these instructions are also like 3+ years out of date so there could be a change in the location or the filename and I have no idea what to find. Please help! I just want to connect to my sql database in localhost to learn web development.
thanks very much.

firebird, Bad File Descriptor/Your user name and password are not defined

I am trying to set up a test environment on my mac (os 10.12) and it requires Fishbowl/Firebird DB. No matter what I do i bounce back and forth between these two errors:
isql localhost:/Users/me/Fishbowl/database/data/EXAMPLE.FDB
which gives me:
Your user name and password are not defined. Ask your database
administrator to set up a Firebird login.
And anything to do using gsec to create user or change password:
And:
Statement failed, SQLSTATE = HY000 operating system directive stat
failed
-Bad file descriptor
This is supremely frustrating. Fishbowl Client itself seems to hit this DB just fine. I have chmod 770 the /tmp/firebird directory and even tried to chown the example.fdb file itself.
Can anyone tell me how I might hit this DB from my java app or commandline? Both ways produce these errors.
1) Your connection line starts with "localhost:". That means you user TCP/IP connection to reach the database server. And the database server is running in a separate process. That means chmod and chown should not matter as long as there is firebird daemon server running and listening at TCP port ( default is 3050 AFAIR, you can read the value of your installation in the text file firebird.conf ).
Indeed, there is so-called "embedded server" or "embedded mode" where the server is loaded as DLL/SO library into the application. But then the connection string can not have network protocol prefix, so that should NOT be your case.
2) You can check documentation at http://firebirdsql.org/manual/isql-switches.html to specify your user and password in the isql command line. The Firebird has one built-in superuser, namely "SYSDBA". Regarding the password it might be a bit complicated.... It differs by Firebird version and platform
2.0) whatever SYSDBA password might be set by the server installation, if server comes in a bundle with some application the said application can override it later. Then you would either have to contact application developers or try to remove the bundled FB and install your own vanilla one, risking rendering the application no more functioning.
2.1) Windows installation of FB 2.x sets the "default" SYSDBA password as "masterkey" (only 8 first symbols actually matter)
2.2) Linux installation of FB 2.x generates a random SYSDBA password and saves it into a text file in Firebird folder.
2.3) MacOS ? Don't know. Perhaps it is closer to Linux than to Windows. So try to find such a text file and try "masterkey"
2.4) With FB 3 the authentication methods and configuration was greatly overhauled, so... So it is quite hard to tell something specific. At least for me.
3) I don't know what Fishbowl ever is, but Google suggests this: https://www.fishbowlinventory.com/wiki/Fishbowl_for_Mac
If that is so, then check the bottomline examples at that page. They stress that you should sudo all those commands. That also makes sense because
3.1) Firebird daemon might have "trusted authentication" enabled, mapping FB users to Operating System users. On UNIX that would at least map SYSDBA to root. On Windows - to Administrator (however it is localized). This does not have to be enabled, but if it is then sudo UNIX command is exactly what makes applications run with OS superuser grants and might explain lack of user and password in the command line examples.
3.2) Firebird embedded server/mode work as part of an application process, and especially with CS (Classic Server) package on UNIX the command line utilities tend to fall into this mode. Then again it needs to be run as root to read highly sensitive data from Firebird Security Database, thus the need to sudo the command. Granted, I do not think your isql command might ever run in embedded mode - because you do specify "localhost:' prefix. But the example at the wiki link above - backup and restore - they use local connection strings, so they probably do run as embedded. So that might give you yet another hint - to try remove "localhost:" prefix from the connection string and to sudo isql rather than running it from regular user. It would hardly be a normal mode, but for test purposes why not.
Hope this helps.
PS. you might also try this Firebird IDE - it is simplistic, but again, for testing purposes... http://www.flamerobin.org/dokuwiki/wiki/manual

How Will Joomla work with MariaDB?

I am already have WAMP stack in my system and I am using Joomla based system. To test MariaDB before using, I installed MariaDB also in my system with Port number 3305. Now, when I try to install Joomla 2.5, there is only option to choose MySQL or MySQLi. Also, there is no option to choose port. Also, there is no such variable in configuration file to add port number and use MariaDB.I think, MariaDB is similar to MySQL so no additional driver required for it.
I am able to connect MariaDB through SQL client as well as from command prompt by just adding port number. So, How can I use MariaDB in Joomla application?
I think it will work if you use the 5.x version. They should act the same as 'normal' mysql. See https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/ to read more about the compatibility betweet MySQL and MariaDB.
Joomla works with MariaDB seamlessly.
You need to make sure you have pdo_mysql available by installing the php-mysql module (may be called php5-mysql depending on your OS and repo).
If its installed properly MariaDB will show up under the mysql heading in phpinfo();
The term "Drop in replacement for MySQL" is being thrown around a lot and MariaDB is far from that. Many things about it are not compatible with MySQL including one major whoopsie: -
MariaDB does not know the variable name default-character-set and if you try to set it in your /etc/my.conf like default-character-set = utf8 the service will not start.
I havent found a way run MariaDB on a server running MySQL or visa versa (not that youd usually want to) since the supporting libs clash. So if you wanna replace one with the other you have to be sure to clean up all dependencies.
The name also makes me uneasy, placing all of my information in a database named Maria feels akin to passing my credit cards to my wives and daughters, just nerve wracking.
But, it does "Drop In" to Joomla just fine.
Enter localhost:3305 as hostname.

Resources