aspnet_regsql error - asp.net

I am trying to run aspnet_sqlreg on my local database (on my machine).
aspnet_regsql -ssadd -sstype c -d "computername\localSqlserveNname" -E
And after it says "Start adding sesson state.", it says that, "An error has occured.... A network-related or instance-spcific eror occurred while establishing a connetion to SQL server. The server was not found or was not accessible." But, I am pretty sure i entered the correct name of the server and database.
Has anyone have similar error?

the error is on the name
aspnet_regsql.exe -ssadd -sstype c -d DATABASENAME -E
where DATABASENAME is the name of your new database, eg try something like "SessionStateDB"
aspnet_regsql.exe -ssadd -sstype c -d SessionStateDB -E

Related

VirtualBox start Script from host

I have a VM started and want to start a script from the host, inside the vm.
My Test Script looks like:
sql /nolog <<!
exit
!
when i start from the host:
VBoxManage --nologo guestcontrol "vmname" run --exe "pathToScript" --username xyz --password xyz
i receive an error: sql command not found. BUT in the VM it works!
Why??
It was because my env variables werent loaded. So you have to load them in your script like:
. .profile #this file contains your env variables
sql /nolog <<!
exit
!

How to export schema of a database in AppMaker

I used the following command from shell to export the schema of the database:
mysqldump -u username -p -no-data database_name> gs://test.sql
I got the following error:
mysqldump: unknown option '-o'.
Then instead I used this:
mysqldump -u username -p -d database_name, ( -d instead of -no-data flag)
I got this error:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
When trying to connect.
Any idea how to export only table definitions in the schema and not all the database.
You're missing the hostname.
mysqldump -h hostname -u username -p -d database_name

unix command is executing before the authentication completed over SSH

i try to open a Unix session through java code and windows using putty.exe as follows:
Runtime.getRuntime().exec("cmd /c start /B C:/scripts/Session.bat ");
the 'Session.bat' file content is:
putty.exe -t -ssh root#aaa -pw abcd -P 22
aaa is the server name.
root is the user name.
abcd is the password
Now, the session opens well, but i want to run couple of simple commands from the above command (ll -s, pwd, etc.).
But when i try to add txt file which contains these commands to the above command, i see that the commands are executing after the user name entered and before the password.
the complete command is:
putty.exe -t -ssh root#aaa -pw abcd -P 22 -m C:\scripts\commands.txt
that's why i get the error (below) since the command "ll" came before the password:
Using username "root".
bash: ll:: command not found
please help me...
Thanks
There is no way the command could execute on the remote computer before the password is processed. Surely an alias is missing in root's bash startup files.
Try adding alias ll='ls -l' to /root/.bash_profile ?

Openstack-Folsom keystone script fail to configure

Based on this link https://github.com/mseknibilel/OpenStack-Folsom-Install-guide/blob/master/OpenStack_Folsom_Install_Guide_WebVersion.rst#openstack-folsom-install-guide , I tried running these scripts but it fails despite me setting the HOST_IP & EXT HOST_IP.
./keystone_basic.sh
./keystone_endpoints_basic.sh
Below is the error log received:-
-keystone:error:unrecognized arguments: service id of 18ea5916544429bed2c84af0303077
I have provide the information such as tenant_name, tenant_id and so on in a source file but it happens to be the script provided does not get recognized by the system. Below are the details of the OS I use.
I created VMs instead of using physical machines. Installed with Ubuntu 12.04 LTS.
Please advice on how to tackle this issue.
Thanks.
I had the same problem. I am using Ubuntu 12.04 LTS. After running:
keystone help user-create tenant id appears as follows:
Optional arguments:
...
--service_id <service-id>
Change --service-id to --service_id with a global replace
[Using command line]
# sed -i 's/--service-id/--service_id/g' /path/to/script.sh
restart keystone & It's database entries
mysql -u root -ppassword -e "drop database keystone"
mysql -u root -ppassword -e "create database keystone"
mysql -u root -ppassword -e "grant all privileges on keystone.* TO 'keystone'#'%' identified by 'password'"
mysql -u root -ppassword -e "grant all privileges on keystone.* TO 'keystone'#'localhost' identified by 'password'"
service keystone restart
keystone-manage db_sync

Invalid object name 'ASPState.dbo.ASPStateTempApplications' - Exception after renaming the ASPState Database

I have created new session database using the command (aspnet_regsql.exe -S -E -ssadd -sstype p) and it created DB called ASPState. Then I renamed it to something like E_ASPStateDB. I have configured the correct DB name in the sessionState connection string. But still it throws the exception Invalid object name 'ASPState.dbo.ASPStateTempApplications'
What i need to do, so that it will use the new database name?
I ran this on the db server that the site was connecting to and it solved it immediately.
USE [ASPState]
GO
DECLARE #return_value int
EXEC #return_value = [dbo].[CreateTempTables]
SELECT 'Return Value' = #return_value
GO
Since you renamed the DB you will have to regenerate the ASPnet session tables. Below is the solution to it.
To Remove, use following command: [open visual studion command prompt]
aspnet_regsql -ssremove -S [SERVER] -U [USER] -P [PWD] -d [DATABASE] -sstype c
Then add them again by following command
aspnet_regsql -ssadd -S [SERVER] -U [USER] -P [PWD] -d [DATABASE] -sstype c
You must modify the stored procedures because they invoke the tables with the database name and schema, as follows:
[ASPState].dbo.ASPStateTempApplications
you have to change it for
[E_ASPStateDB].dbo.ASPStateTempApplications
once you have registered a DB name using aspnet_regsql, you shall have to use the name you registered with. There is no point really to change the name afterwards. If you really want to use a name like E_ASPStateDB, why not delete the registration of ASPState first and then re-registering with the name E_ASPStateDB. It shall make your life easier

Resources