Now, I don't know how to start mariadb since I didn't install it as a running service.
This didn't help me: https://mariadb.com/kb/en/mariadb/starting-and-stopping-mariadb/
I googled and thought this would work to set it as a service:
C:\Program Files\MariaDB 10.0\bin>mysql_install_db.exe --datadir=c:\mariadb --service=MyDB --password=secret Running bootstrap Removing default user Setting root password Creating my.ini file Registering service 'MyDB' FATAL ERROR: OpenSCManager failed (5)
http://kb.askmonty.org/v/installation-issues-on-windows contains some help for solving the most common problems. If this doesn't help you, please leave a comment in the Knowledgebase or file a bug report at http://mariadb.org/jira
I then went and issued this command: C:\Program Files\MariaDB 10.0\bin>mysqld.exe --datadir=../data
But it just stays there blinking. Yes, I can connect to maria db with Heidisql, but does the above command prompt suppose to blink one line under the above command?
Now, I don't know how to shutdown the database. I went to the documentation and can't find this command: mysql.server stop
But there's no such command / script for windows 7.
I tried:
C:\Program Files\MariaDB 10.0\bin>mysqladmin -u root -p shutdown Enter password: ******** mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to MySQL server on 'localhost' (10061 "Unknown error")' Check that mysqld is running on localhost and that the port is 3306. You can check this by doing 'telnet localhost 3306'
I'm using windows 7.
I've read http://dev.mysql.com/doc/mysql-startstop-excerpt/5.0/en/windows-server-first-start.html
that to start the server I run inside the bin directory mysqld --console
I ran this command to stop mariadb, but it didn't seem to work:
C:\Program Files\MariaDB 10.0\bin>mysqladmin shutdown -p Enter password: ******** mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'ODBC'@'localhost' (using password: YES)'
I'm able to connect still.
What's the correct way for me to start and stop maria db (latest version 3/15/2015) on windows 7?
Update: I'm able to use this to shutdown: mysqladmin -u root -p shutdown
Is there a correct way to start and shutdown mariadb? I really don't want mariadb to be running automatically whenever I turn on my machine.
Thanks.
Here's what you do.
services
cmd
or powershell
cd C:\Program Files\MariaDB 10.0\bin
mysqld --remove
mysqld --install
mysqld --start
That sequence of operations should remove the service and then install it. Finally it will start it. If you don't use a shell in Administrator mode, this won't work.
You can double check this is right by closing, reopening, and looking at the Services app in the Microsoft Management Console.
Why does this work? Because, like many service .exe programs, MySQL and MariaDB servers are self-installing: they contain the necessary code to install and remove themselves as services.
Just so to have it documented. This is not specific to MariaDB at all, just to MSI in general. If you forgot to install MSI feature (which, for MariaDB is 'Database Instance') you start the MSI again, click on "Next" in the Welcome page, in the "Change/Repair/Remove" dialog choose "Change", select 'Database Instance' in the feature selection list, "Next" et voila, it will be installed.
If you forgot to check the service checkbox, the easiest is uninstall and install again, it goes really fast.
As for mysql_install_db.exe, it must be run in an elevated console, and you would not have experienced any problems if it had(this is also documented)
Please, avoid "mysqld --install", it is very limited. Only if you want to compromise your computer running mysqld under the most powerful Windows account, then use it.
Instead, mysql_install_db.exe if you need many instances on the machine, or the MSI otherwise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With