Microsoft SQL Server, 错误:4064的解决方法

SQL Server错误代码解析与故障排除指南 关系型数据库管理系统(RDBMS)通过错误代码机制实现系统与用户的精确通信。SQL Server作为主流企业级数据库,其错误代码体系包含错误编号、严重级别和状态代码等结构化信息,为DBA和开发人员提供快速故障定位能力。从技术原理看,错误代码本质上是数据库引擎的状态反馈机制,通过预定义的代码体系实现标准化的错误报告。在工程实践中,掌握错误代码解析能显著提升数据库运维效率,特别是在身份验证(如错误18456)、连接问题(如错误233)和资源管理(如错误701)等典型场景。通过结合SQL Server错误日志和扩 阅读详情

 

SQL SERVER – Fix : Error: 4064 – Cannot open user default database. Login failed. Login failed for user

I have received following question nearly 10 times in last week though emails. Many users have received following error while connecting to the database. This error happens when database is dropped for which is default for some of the database user. When user try to login and their default database is dropped following error shows up.

Cannot open user default database. Login failed.
Login failed for user ‘UserName’. (Microsoft SQL Server, Error: 4064)

The fix for this problem is very simple.

Fix/Workaround/Solution:

First click on Option>> Button of “Connect to Server” Prompt.

Now change the connect to database to any existing database on your server like master or msdb.

Now click on connect and it will successfully log you in. Once you login in the system run following statement for your username and it should fix your problem. Make sure to replace [test] with your username and master with yourdatabase name.

ALTER LOGIN [test] WITH DEFAULT_DATABASE = master
GO

SQLServer无法打开用户默认数据库 登录失败错误4064的解决方法 无法打开用户默认数据库,登录失败,其原因是登录帐户的默认数据库被删除。     解决办法是使用管理员帐户修改此登录帐户的默认数据库。     1、使用管理员帐号登入企业管理器,在“对象资源管理器”中,展开“安全性”——“登录名”,右键该帐户点击“属性”     2、在“登录属性”的对话框中,第一个“常规”选项卡界面的右边更改默认的数据库。     如果出问题的就是你的管理员帐户,你无法登入企业管理器里修改,可以使用以下命令,     SQL Server 2000用户打开CMD命令提示符,使用以下命令:          SQL帐户登录方式:isql -U”密码” -P”jtydl” -d 立即下载

相关推荐

Oracle 19c RAC安装踩坑实录:OpenSSH 8.x版本与OUI的“兼容性战争”及一劳永逸的解决思路

本文深入解析Oracle 19c RAC在Linux8环境中部署时遇到的OpenSSH 8.x版本兼容性问题,特别是[INS-06006]错误的根源与解决方案。从协议层分析冲突本质,提供SCP包装器技术、官方补丁应用指南及现代化部署体系构建三种解决方案,帮助企业高效完成RAC安装并规避类似问题。

weixin_42648844的博客 458

不能打开默认数据库

Cannot open user default database. Login failed. Login failed for user ‘UserName’. (Microsoft SQL Server, Error: 4064) 解决方法: 1.打开"option"选项2.点击"connection properties"3.在“ Connect to data

csjsias的专栏 654

Arduino-Pico:用Arduino生态开发树莓派RP2040双核与PIO实战

在嵌入式开发领域,微控制器编程是连接硬件与软件的核心技能。其原理在于通过编写代码直接控制处理器与外设,实现特定功能。掌握这项技术能极大提升开发效率,降低硬件操作门槛,广泛应用于物联网、智能硬件和自动化控制等场景。本文聚焦于如何利用Arduino这一广受欢迎的生态,来开发树莓派RP2040微控制器。RP2040以其双核Cortex-M0+架构和独特的可编程IO(PIO)硬件而著称,性能强大。通过第三方Arduino核心(arduino-pico),开发者可以沿用熟悉的Arduino语法和库,快速调用双核并行处

weixin_26905423的博客 381

sql server 2008 登录 4064 错误解决办法

出现这个错误是账户无法打开默认数据库导致的 修改一下该账户的默认打开数据库即可。 如果很不幸,你的sa帐号和windows身份验证默认都打开同一个数据库,那么无论换哪种方式登录都是一样没用的 如果你有一个帐号能登录,直接在安全性-登录名那里右键用户名属性修改默认数据库为master即可。 如果2种方式都无法登录,则按下面的命令修改一下sa的默认数据库 如果很不幸,把sa密码给忘...

altzlo7909的博客 622

Apk脱壳圣战之---脱掉“梆梆加固”的保护壳

一、前言 现如今Android用户的安全意识不是很强,又有一些恶意开发者利用应用的名字吸引眼球,包装一个恶意锁机收费的应用,在用户被骗的安装应用之后,立马手机锁机,需要付费方可解锁。这样的恶意软件是非常让人痛恨的。所以本文就用一个案例来分析如何破解这类应用,获取解锁密码,让被骗的用户可以找回爽快! 二、分析软件锁机原理 本文用的是一款叫做:安卓性能激活.apk,关于样本apk文件后面会...

尼古拉斯.赵四的博客 5061

DVWA全级别详细通关教程

dvwa全级别详细通关教程,暴力破解,命令注入,CSRF跨站请求伪造,文件包含,文件上传​,SQL注入,XSS

m0_62063669的博客 1万+

成功解决Cannot open database "xxx" requested by the login.The login failed

连接sqlserver数据库报错信息入下所示:Cannot open database "xxx" requested by the  login.The login failed解决方法:http://www.yayihouse.com/yayishuwu/chapter/1242

qq_30908729的博客 1万+

Label Studio + SAM2分割半自动标注与yolo11训练

Label Studio + SAM2分割半自动标注与yolo11训练

schFallingCloud 1408

所有login都不能登录,默认数据库离线导致

 分离了一个用户数据库后,重启数据库服务,再登录时发现登录失败,提示:Cannot open user default database. Login failed.所有login都不能登录,都是上述这个错误.即使在ssms中用dac方式(admin:instance),也不能登录.注: 不需要重建master数据库,或者恢复master数据库.解决办法:1,在服务器本地用命令行执行: s

风格的BLOG 1134

远程桌面项目

远程桌面项目

weixin_41560737的博客 1934

基于RK3588的高效音视频对讲系统设计与实现

本文详细介绍了基于RK3588芯片的高效音视频对讲系统设计与实现。文章深入剖析了RK3588在8K编解码、高性能音频DSP及丰富接口方面的优势,并提供了从开发环境搭建、分层软件架构设计,到视频采集编码、音频回声消除及低延迟网络传输的完整实战指南,旨在帮助开发者充分利用该芯片硬件能力,构建稳定、低延迟的实时通信系统。

dapp9builder的博客 256

SQL--sql server无法打开用户默认数据库 登录失败错误4064的解决方法

开始--运行--Dos命令 SQL 2000:isql -U"sa" -P"123456" -d"master" -Q"exec sp_defaultdb N'sa', N'master'" SQL 2005/2008:sqlcmd -U"sa" -P"123456" -d"master" -Q"exec sp_defaultdb N'sa', N'master'"

慢谈人生 6108

基于STM32设计的遥控灭火消防小车_296

随着城市化进程的加速和火灾发生频率的增加,传统的消防方式在应对初期火灾时存在反应慢、效率低等问题。为了提高火灾响应速度和灭火效率,本设计开发了一款基于STM32单片机的遥控灭火消防小车。该小车配备了烟雾检测、温湿度监测、火源定位、灭火操作等功能,能够通过蓝牙和WIFI实现远程控制与实时视频传输。设计采用了MQ2烟雾传感器、SHT30温湿度传感器、火光传感器和ESP32摄像头模块等硬件设备。系统不仅能够自动检测和定位火源,还可以手动调整灭火器对准位置,进行干粉灭火。此外,蜂鸣器用于火源报警,确保操作人员及时得

724

【转载]】Microsoft SQL Server, 错误:4064的解决方法

SQL SERVER – Fix : Error: 4064 – Cannot open user default database. Login failed. Login failed for user November 4, 2008 by pinaldave I have received following question nearly 10 times in last ...

anshi5303的博客 439

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Microsoft SQL Server, 错误:4064的解决方法 (转载)

SQL SERVER – Fix : Error: 4064 – Cannot open user default database. Login failed. Login failed foruser November 4, 2008 by pinaldave I have received following question nearly 10 times in last w...

weixin_30832405的博客 762

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

sa登陆失败 SQL Server错误18456的解决方法

昨天我的SQL(Microsoft SQL Server 2005 )登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考)查找问题的过程:(注:用windows账号还是可以登录的)第一步:启动所有与SQL有关的服务,问题依旧;第二步:查看windows防火墙,被默认启动了,不启动选择项被Disabled两个

roboot的专栏 1275

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

SQL(Microsoft SQL Server 2005)几种登陆不成功错误解决办法

昨天我的SQL(Microsoft SQL Server 2005 )登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考) 问题一、忘记了登录Microsoft SQL Server 2005 的sa的登录密码 解决方法:先用windows身份验证的方式登录进去,然后在‘安全性’-‘登录’-右键单击‘sa’-‘属性’,修改

我的收藏 2068

php sqlserver登录失败,SQLServer无法打开用户默认数据库,登录失败,错误提示4064

今天再给客户调试系统数据库的时候,我的Microsoft SQL Server 2005在我删除一个数据库后突然登录不上去了,出现"SQLServer无法打开用户默认数据库,登录失败,错误4064"提示,现在想为什么会出现这个问题呢?以前从来没有过,细细回忆这一现象的出现,原因是我的数据库中其中一个数据库在我给予SA用户名登陆权限,把这个数据库删除而出现的。查找问题的过程:(注:用windows账...

weixin_33891343的博客 663

SQL SERVER "Cannot Open User Default Database, Login Failed"故障解决

每位用户都有一个默认的数据库。当您连接到运行 Microsoft SQL Server 的计算机时,如果未指定登录数据库,则将使用默认的数据库。但是,如果默认数据库在连接时不可用,则可能无法进行连接。并且,您将收到错误消息 4062 或错误消息 4064。这些错误消息的原文如下所示: 无法打开用户默认数据库(Cannot Open User Default Database)解决方法如...

weixin_30664539的博客 997

无法打开用户默认数据库,登陆失败 (Microsoft SQL Server ,错误:4064)

今天操作Sql Server 2008时遇到一个问题,我先前制定了sa用户默认的数据库,如下图所示:     然后,我把Library数据库删掉后,再重新登陆SQL Server时报错,错误消息如下图所示:    通过使用SQLCMD实用工具修改用户Sa默认数据库即可。   第一步:找到SQLCMD所在目录,如图:    在DOS里进入该

天马行空 9771

SQL SERVER 2005 登陆18456错误的解决方法

昨天我的SQL(Microsoft SQL Server 2005)登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考)查找问题的过程:(注:用windows账号还是可以登录的)第一步: 启动所有与SQL有关的服务,问题依旧;第二步: 查看windows防火墙

老汉--小庙和尚 21万+

Microsft Sql Server:Error 4064 数据库登录错误

连数据库时,登录帐户的默认数据库无法打开,报错Microsft Sql Server:Error 4064,用户无法连接登录数据库。分析原因:这个账号的默认数据库的.mdf文件被我移动到其它路径去了,打开默认数据库失败,所以导致了这个账号的拒绝登陆。解决方法:在使用客户端登陆,点击 Options 在Connection Properties中的Connect to database选项,default改为master,然后登录。

shawn_lu的专栏 1106

转载 SQL SERVER 2005 登陆18456错误的解决方法

<br />昨天我的SQL(Microsoft SQL Server 2005 )登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考)<br /> 查找问题的过程:(注:用windows账号还是可以登录的)<br /> 第一步: 启动所有与SQL有关的服务,问题依旧;<br /> 第二步: 查看windows防火墙,被默认启动了,不启动选择项被Disabled<br /> 两个提示“由于安全考虑,某些设置由组策略控制”

taogang1108的专栏 778

SQL Server 2005 连接不上本地数据库引擎的解决方法

1.右键服务器,属性--安全性,服务器身份验证选SQL Server和windows身份验证模式,试试看!  2.SQL SERVER 2005 登陆18456错误的解决方法:       SQL(Microsoft SQL Server 2005 )登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考)

herb777的专栏 3万+

【sqlserver】用户‘sa’登入失败。(Microsoft SQL Server,错误:4064)

故障现象: 解决方法: 改用windows身份验证方式登入,选择数据库服务器名称->右键选择‘属性’->在常规选项卡中,重设密码并修改默认数据库为master ...

博客 735

Microsoft SQL Server Management Studio Express

     我删除sql server 2005默认登陆数据库后,windows登陆也不可以。最后在登陆是修改了登陆数据库,就可以登陆。可是,登陆后,新建数据库 等等功能不正常使用,得出一下报错:请问哪位高手可以指点指点啊。===================================无法显示请求的对话框。===============================

purists的专栏 1716
上一篇: 计算机程序员的表白(转)
下一篇: 2 循环结构
阿达King哥
博客等级 码龄23年 387粉丝 244原创
评论 7
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值