MariaDB安装:我在安装过程中未选中作为服务运行.启动和停止mariadb的正确方法是什么? [英] MariaDB install: I unchecked running as service during installation. What is correct way to start and stop mariadb?

查看:230
本文介绍了MariaDB安装:我在安装过程中未选中作为服务运行.启动和停止mariadb的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我不知道如何启动mariadb,因为我没有将其安装为正在运行的服务.

Now, I don't know how to start mariadb since I didn't install it as a running service.

这对我没有帮助: https://mariadb.com/kb/zh-CN/mariadb/starting- and-stopping-mariadb/

我搜索了Google,并认为这可以将其设置为服务:

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 =秘密 正在运行的引导程序 删除默认用户 设置root密码 创建my.ini文件 注册服务"MyDB" 严重错误:OpenSCManager失败(5)

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-在Windows上包含一些帮助 解决最常见的问题.如果这对您没有帮助,请 在知识库中发表评论或在以下位置提交错误报告 http://mariadb.org/jira

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

然后我去执行以下命令: C:\ Program Files \ MariaDB 10.0 \ bin> mysqld.exe --datadir = ../data

I then went and issued this command: C:\Program Files\MariaDB 10.0\bin>mysqld.exe --datadir=../data

但是它只是在那里闪烁.是的,我可以使用Heidisql连接到maria db,但是上面的命令提示符是否应该在上面的命令下闪烁一行?

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?

现在,我不知道如何关闭数据库.我去了文档,找不到此命令:mysql.server stop

Now, I don't know how to shutdown the database. I went to the documentation and can't find this command: mysql.server stop

但是Windows 7没有这样的命令/脚本.

But there's no such command / script for windows 7.

我尝试过:

C:\ Program Files \ MariaDB 10.0 \ bin> mysqladmin -u根-p关闭 输入密码: ******** mysqladmin:连接到"localhost"服务器失败 错误:无法连接到本地主机"上的MySQL服务器(10061未知错误")" 检查mysqld是否在localhost上运行,端口是否为3306. 您可以通过执行"telnet localhost 3306"进行检查

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'

我正在使用Windows 7.

I'm using windows 7.

我读过 http://dev.mysql .com/doc/mysql-startstop-excerpt/5.0/en/windows-server-first-start.html

要启动服务器,我在bin目录mysqld --console内运行

that to start the server I run inside the bin directory mysqld --console

我运行了此命令以停止mariadb,但它似乎不起作用:

I ran this command to stop mariadb, but it didn't seem to work:

C:\ Program Files \ MariaDB 10.0 \ bin> mysqladmin关闭-p 输入密码: ******** mysqladmin:连接到"localhost"服务器失败 错误:对用户'ODBC'@'localhost'的访问被拒绝(使用密码:是)'

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)'

我仍然可以连接.

我在Windows 7上启动和停止maria db(最新版本3/15/2015)的正确方法是什么?

What's the correct way for me to start and stop maria db (latest version 3/15/2015) on windows 7?

更新: 我可以使用它来关闭: mysqladmin -u root -p关闭

Update: I'm able to use this to shutdown: mysqladmin -u root -p shutdown

是否有启动和关闭mariadb的正确方法?我真的不希望mariadb在每次打开计算机时都自动运行.

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.

谢谢.

推荐答案

这就是您要做的事情.

  1. 在Microsoft管理控制台中打开服务"应用程序.
    • 点击开始"按钮
    • 键入services
    • 按Enter键.
  1. Open the Services app in the Microsoft Management Console.
    • hit the start button
    • type services
    • hit the enter key.
  • 向下滚动以找到MySQL服务
  • 双击它
  • 如果可以,请按停止"按钮.
  • 点击开始按钮,然后输入cmdpowershell
  • 右键单击开始菜单中显示的程序.
  • 单击以管理员身份运行"项.
  • hit the start button and type cmd or powershell
  • right click on the program that shows up in the start menu.
  • click the Run As Administrator item.
  1. 键入mysqld --remove
  2. 键入mysqld --install
  3. 键入mysqld --start
  1. Type mysqld --remove
  2. Type mysqld --install
  3. Type 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.

您可以通过关闭,重新打开并在Microsoft管理控制台中查看服务"应用程序来再次确认是否正确.

You can double check this is right by closing, reopening, and looking at the Services app in the Microsoft Management Console.

为什么这样做?因为与许多服务.exe程序一样,MySQL和MariaDB服务器是自动安装的:它们包含必要的代码,以作为服务进行安装和删除.

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.

这篇关于MariaDB安装:我在安装过程中未选中作为服务运行.启动和停止mariadb的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆