mysql使用export导出数据_Mysql导出数据库(Mysql Export Database)
Mysql导出数据库(Mysql Export Database)我有一个主机,其中包含一些数据库问题是我无法访问MySQL。数据库位于.ibd / .frm中我有几个问题:我不知道mysql的密码(我没有创建它),也不知道如何重置它我不知道如何导出数据库。 我试图安装phpmyadmin,但因为我不知道密码,所以无法连接我试图与Mysql Workbench连接,但是我得到了结果:无法连接到my
Mysql导出数据库(Mysql Export Database)
我有一个主机,其中包含一些数据库问题是我无法访问MySQL。
数据库位于.ibd / .frm中
我有几个问题:
我不知道mysql的密码(我没有创建它),也不知道如何重置它
我不知道如何导出数据库。 我试图安装phpmyadmin,但因为我不知道密码,所以无法连接
我试图与Mysql Workbench连接,但是我得到了结果:无法连接到mysql(在读取初始通信包,系统0时丢失了与Mysql Server的连接
当我尝试按照程序重置mysql密码时,我首先执行了以下操作:
sudo mysql stop
但我得到以下错误:
sudo: unable to open /etc/sudoers.d/README: No such file or directory
stop: Unknown instance:
我怎样才能访问这个数据库以及导出它的最佳方式是什么?
I have a hosting which included some database problem is I can not access to mysql.
database are in .ibd / .frm
I have a few problems:
I don't know the password of mysql ( I did not create it) and don't know how to reset it
I don't know how to export the database. I tried to install phpmyadmin but because I don't know the password I can not connect
I tried to connect with Mysql Workbench but I got the result: Failed to connect to mysql (lost connection to Mysql Server at "reading initial communication packet, system 0
When I try to follow procedure to reset mysql password I did first:
sudo mysql stop
but I get the following error:
sudo: unable to open /etc/sudoers.d/README: No such file or directory
stop: Unknown instance:
How can I get access to this database and what is the best way to export it?
原文:https://stackoverflow.com/questions/48127668
更新时间:2019-07-08 19:46
最满意答案
其次,你不要停止这样的服务。 假设你有openrc,它会是:/etc/init.d/mysql stop
最后你必须以安全模式启动mysql才能更改root密码。 按照这个线程: MySQL根密码更改
Second, you don't stop the service like this. Assuming that you have openrc it would be: /etc/init.d/mysql stop
And finally you have to start mysql in safe mode to change the root password. Follow this thread: MySQL root password change
2018-01-06
相关问答
mysqldump是一个命令行界面,不是SQL的一部分。 从bash(或类似)运行命令。 mysqldump is a command line interface and not a part of SQL. Run the command from bash (or similar).
mysql-ctl cli
GRANT ALL PRIVILEGES ON *.* TO @localhost;
SHOW VARIABLES LIKE 'socket';
quit;
mysqldump -u --protocol=tcp -S /home/ubuntu/lib/mysql/socket/mysql.sock --all-databases > db.sql
有两个技巧。 首先,mysqldump并没有让我像普通的root用户那样运行
...
mysqldump将默认备份所有触发器,而不是 存储过程/函数 。 有两个mysqldump参数可以控制此行为: --routines - 默认为FALSE --triggers - 默认为TRUE 所以在mysqldump命令中,添加--routines如下: mysqldump --routines > outputfile.sql
阅读更多在这篇文章 mysqldump will backup by default all the tri
...
这里有几个问题。 首先你需要检查你的sudo设置和权限: https : //askubuntu.com/questions/482932/sudo-unable-to-stat-etc-sudoers-d-readme-no-such-file-or- directory 其次,你不要停止这样的服务。 假设你有openrc,它会是:/etc/init.d/mysql stop 最后你必须以安全模式启动mysql才能更改root密码。 按照这个线程: MySQL根密码更改 you have sev
...
要转储数据库,您需要“mysqldump”工具,但如果在服务器上没有此工具并且无法安装它,您将需要一个在所有表上运行的复杂脚本,并收集表结构和数据,如下所示: http: //davidwalsh.name/backup-mysql-database-php To dump database you need "mysqldump" tool, but if do not have this tool on server and can not install it, you'll need a
...
我已经使用rsync很好地移动文件并在其他盒子上使用它们。 我从来没有用MYSQL运行,但是我已经从/ var / lib / mysql中的文件中恢复,没有任何问题。 这是一个很好的方法来“复制”你的“开发”框中的数据库。 我建议关闭mysql,移动文件然后重新开始备份。 这就是我在必要时完成的。 myqldump为你提供了漂亮的SQL代码,不过如果你需要在sed中“调整”某些东西的话。 尽管如此,我并不担心使用rsync。 我将它用于许多目的,包括将代码更新推送到客户机。 I've used
...
只需编辑 select *
有点像 select FirstName, LastName, Postcode, Email from $table
(并且尽量不要使用已弃用的mysql_* functinons,如果可能的话使用PDO)。 Just edit the select *
bit, like select FirstName, LastName, Postcode, Email from $table
(and try not to use the deprecated mys
...
我认为你的意思是IMPORT 。,方法如下: load data local infile 'yourCSVfilepath.csv' into table tableNameHERE
fields terminated by ','
optionally enclosed by '"'
lines terminated by '\r\n'
I think you mean IMPORT., here's how: load data local infile 'yourCSVfilepath.
...
你的问题可能是你在两个不同的上下文中使用变量$row ...试试这个: $row = 1;
while($mrow = mysql_fetch_assoc($res)) {
$col = 0;
foreach($mrow as $key=>$value) {
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $row, $value);
$col++;
...
如果迁移是从Microsoft SQL Server迁移到MySQL,这可能会有所帮助 使用Workbench迁移向导从ms sql server迁移到mysql If the migration is from Microsoft SQL Server to MySQL, this might help Migrating from ms sql server to mysql using workbench migration wizard
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)