Daily Archives

Articles indexed Sunday March 18 2012

Page 4/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • "Directory index forbidden by Options directive" when deleting or renaming folders through webdav

    - by sandwiches
    I am trying to delete folders through webdav but all I get is 403 on the client and "Directory index forbidden by Options directive" in the Apache error log. I enabled "options indexes" for the folder and I stopped getting the errors in either the client or the log, but I still can't rename or delete folders through webdav. Any ideas why I'm unable to edit folders through webdav? I am running WAMP, default installation with Apache 2.2.17. I can connect, create files, delete files, rename them, etc. I can create folders but not delete them or rename them, once they're created. On the access log, whenever I try to delete, I get this: "DELETE /uploads/shahs HTTP/1.1" 301 243 On the error log, I get: Directory index forbidden by Options directive: The Webdav client gives a 403 when trying to delete or rename folders. Once, I added "options indexes," I stopped getting the error message in the Apache error log and the 403 on the webdav client, but now, deleting or renaming does nothing. No error messages, but nothing happens, at all.

    Read the article

  • Windows Server 2008 R2 Virtual Network Setup

    - by jpearl01
    Some background: I'm very much new to networking in general, and virtualization in particular. I'm trying to set up a series of VMs as we are transitioning to a thin client setup. I have been supplied a limited number of static ip addresses. The server is located in an offsite building which houses the network we use to connect to the internet, share folders etc. The setup I've been trying to go for is this: The host OS (Windows Server 2008 R2) is bound to one nic using one of the static ips (say, Nic1 and ip 10.255.6.61). I've set up another external virtual network attached to another physical nic , and a virtual private network attached to no nic. There is one VM running the same os (as the host). This VM is connected to both the external virtual network (and uses another static ip say Nic2 and ip 10.255.6.62) and also to the virtual private network (I gave it a static random ip 192.168.88.1 subnet mask 255.255.255.0). This virtual private network is connected to all the other VMs. I'd like to share the internet connection with all the other VMs on the private virtual network, and so I installed the RRAS role on the server connected to Nic2, and selected the option to share the internet over the vpn. I've run through the RRAS wizard a few times, trying different configurations, but none of them seem to be letting the other vms connect to the 'net. The vms seem to connect to the virtual private network fine, they are assigned an ip address and everything, but no internet, and no rest of the network either. The other problem is in general I connect to the vms with RDP. Will that be possible with a setup like this? i.e. will the vms show up as computers on the network? If not, what are my other options? Thanks! ~josh

    Read the article

  • Xen command xl doesn't create a vm but xend/xm does

    - by ineff
    I'm a newbie to Xen, and I've recently installed Xen 4.2 by sources on my system. I've found a strange thing I've a VM when I start it via the command "xm create machine.cfg" all work fine, but if I use "xl create machine.cfg" it gives me the following error xc: error: panic: xc_dom_core.c:442: xc_dom_alloc_segment: segment ramdisk too large (0x4ba 0x2000 - 0x1bd9 pages): Out of memory libxl: error: libxl_dom.c:208:libxl__build_pv xc_dom_build_image failed: Invalid argument cannot (re-)build domain: -3 xenconsole: Could not read tty from store: No such file or directory What could be the problem? Any idea?

    Read the article

  • Wifi interference tool for Mac

    - by Kevin Burke
    This Server Fault blog post shows some tools you can use to view interference on your wireless network: blog.serverfault.com/2012/01/05/a-studied-approach-at-wifi-part-2/. They mention Vistumbler, which only works on PC's. Is there a similar tool I can use to measure wireless interference on a Mac? Also, is it better to be on a channel with many AP's, each with a weak signal, or on a channel with only a few AP's, but a strong signal?

    Read the article

  • htaccess redirect loop

    - by Web Developer
    I am having issue in the last line of the below code which is causing the redirect loop (at least that's what i think so) RewriteEngine On RewriteBase /jgel/ RewriteCond %{REMOTE_ADDR} !^172\.172\.121\.142 RewriteCond %{REQUEST_URI} !maintainance\.php RewriteCond %{REQUEST_URI} !resources/(.*)$ [nc] RewriteRule ^(.*)$ maintenance.php [R=307,L] I have tried this and this too doesn't work RewriteEngine On RewriteBase / RewriteCond %{REMOTE_ADDR} !^172\.172\.121\.142 RewriteCond %{REQUEST_URI} !maintainance\.php RewriteCond %{REQUEST_URI} !resources/(.*)$ [nc] RewriteRule ^(.*)$ /jgel/maintenance.php [R=307,L]

    Read the article

  • ActiveSync devices causing accounts to lockout

    - by Abdullah
    When a user changes his account password for whatever reason (read: expired), and the old password is stored in his mobile device connected through EAS. This will cause his account almost immediately - as it should according to the lockout policy defined in the AD. It was easy to figure out that part. The hard part is keeping it from happening. I looked everywhere. Nothing. Basically there are four parts to the puzzle: the EAS device, the TMG (ISA) server, the EAS protocol and finally the AD. None of them have a way to stop the EAS device from failing to authenticate. So I figured I'll have to come up with a clever workaround. And the only thing I could come up with is to create a group for all EAS users and exclude them from the lockout policy, which obviously defeats the whole purpose of the policy, or to educate the users to update their devices with the new passwords, which is impossible. The question: Can you think of any other way to prevent EAS from locking out the accounts? Environment: Mostly iOS devices all through EAS. TMG 2010. Exchange 2007. AD 2008 R2.

    Read the article

  • Remote Desktop over VPN or SSH?

    - by Jonathan
    I want to provide a remote employee remote desktop into a PC in the office and am trying to decide between the following two options: Use Microsoft VPN to get him a local network IP. Use RDP to connect to host machine. Use local SSH tunneling for VPN port. Connect RDP to localhost:portNumber Is either option more secure than the other? Will either option perform better than the other? Are there any better options I've missed or considerations I should make?

    Read the article

  • nginx+django serving static files

    - by avalore
    I have followed instruction for setting up django with nginx from the django wiki (https://code.djangoproject.com/wiki/DjangoAndNginx) and have nginx setup as follows (a few name changes to fit my setup). user nginx nginx; worker_processes 2; error_log /var/log/nginx/error_log info; events { worker_connections 1024; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" ' '"$gzip_ratio"'; client_header_timeout 10m; client_body_timeout 10m; send_timeout 10m; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 4 2k; request_pool_size 4k; gzip on; gzip_min_length 1100; gzip_buffers 4 8k; gzip_types text/plain; output_buffers 1 32k; postpone_output 1460; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 75 20; ignore_invalid_headers on; index index.html; server { listen 80; server_name localhost; location /static/ { root /srv/static/; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { access_log off; expires 30d; } location / { # host and port to fastcgi server fastcgi_pass 127.0.0.1:8080; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param QUERY_STRING $query_string; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_pass_header Authorization; fastcgi_intercept_errors off; fastcgi_param REMOTE_ADDR $remote_addr; } access_log /var/log/nginx/localhost.access_log main; error_log /var/log/nginx/localhost.error_log; } } Static files aren't being served (nginx 404). If I look in the access log it seems nginx is looking in /etc/nginx/html/static... rather than /srv/static/ as specified in the config. I've no clue why it's doing this, any help would be hugely appreciated.

    Read the article

  • Any web interface to show deployments history with mcollective?

    - by Jason
    I'm using mcollective & puppet for deployments. I would like to know if there is any user interface which allows me to choose a specific package/version and deploy and any user interface i can already use which allows me to show the deployments history and their status. (I saw that glu has a nice user interface i'm looking for something like it, http://linkedin.github.com/glu/docs/latest/html/tutorial.html ) I wondered if i could use glu (so that i can get their deployment history gui if they have a good one...) with mcollective but from what i understand they are parallel frameworks.

    Read the article

  • Taking an image backup of an entire server?

    - by WarDoGG
    I am currently using a dedicated server for my hosting needs. However, the costs are too high and I would like to suspend everything until I work out my business strategy again. Is there a way I can take a complete backup of the filesystem and run it in VMWare ? I cannot just copy the entire filesystem because there are lots of tools installed and tight changes to the server configuration files I myself dont know about (by the developers), but I need a snapshot of the entire disk image along with processes installed and everything is as is because for development needs, I need to work on this copy in VMWare or VirtualBox etc. Is it possible for me to take a full image copy ? How do I do it ?

    Read the article

  • Installing PHP with iconv on Mac OSX 10.6 gives error: "Undefined symbols for architecture x86_64"

    - by Jason
    I am setting up PHP on my local web server with iconv, which should be there by default, but I am getting the following error: Undefined symbols for architecture x86_64: "_iconv", referenced from: __php_iconv_strlen in iconv.o _php_iconv_string in iconv.o __php_iconv_strpos in iconv.o __php_iconv_appendl in iconv.o _zif_iconv_substr in iconv.o _zif_iconv_mime_encode in iconv.o _php_iconv_stream_filter_append_bucket in iconv.o ... (maybe you meant: _zif_iconv_strlen, _zif_iconv_strpos , _zif_iconv_mime_decode , _php_iconv_string , _zif_iconv_set_encoding , _zif_iconv_get_encoding , _zif_iconv_mime_decode_headers , _iconv_functions , _zif_iconv_mime_encode , _zif_iconv_strrpos , _iconv_module_entry , _iconv_globals , _zif_iconv_substr , _php_if_iconv , _zif_ob_iconv_handler ) ld: symbol(s) not found for architecture x86_64 Now, presumably this means that my iconv is not 64 bit. I tried to download libiconv and manually reinstall it with 64 bit, as such: CFLAGS='-arch i386 -arch ppc -arch ppc64 -arch x86_64' CCFLAGS='-arch i386 -arch ppc -arch ppc64 -arch x86_64' CXXFLAGS='-arch i386 -arch ppc -arch ppc64 -arch x86_64' ./configure But I get the following error: configure: error: in `/Users/jason/Downloads/libiconv-1.13.1': configure: error: C compiler cannot create executables See `config.log' for more details. In my config.lob file, it says at the bottom: configure: exit 77 Any suggestions?

    Read the article

  • rhn_register through HTTP Proxy with Authentication

    - by kjloh
    Is there any limitation to the proxy authentication support of rhn_register? The proxy of the network I'm on sends the follow 407: HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) Via: 1.1 VANESSA Proxy-Authenticate: Negotiate Proxy-Authenticate: Kerberos Proxy-Authenticate: NTLM It seems that rhn_register is not able to any of the authentication schemes above. Any advise?

    Read the article

  • About rw init=/bin/bash

    - by triedtoomuck
    I am a linux newbie so excuse me if I ask silly things. I recently find out that if I edit GRUB before booting and I add rw init=/bin/bash I end up with a root shell. Being in a condition that I want to understand everything I would like to know why this happens. I mean is it a bug? is it a feature? is it there to help admins to fix things as it only works if you have physical access to a computer? Which part are we exploiting? GRUB or the actual kernel? Sorry for asking a lot of things.

    Read the article

  • Getting a list of packages installed on CentOS (by command line and on the web)

    - by sameold
    When installing CentOS (6.2), it installs a whole bunch of packages, but the installation is often very fast, it's hard to note the names of the packages. I have a couple of questions: 1) I'm guessing I could wait for the entire installation to complete and then query for the list of installed packages on the system. How do I do that? 2) Is there a printed list somewhere on the web, so I don't have to install the OS first just to get the list?

    Read the article

  • Can I completely convert an Ubuntu desktop installation to a server one? (not just the packages)

    - by Rey Leonard Amorato
    I am aware that the server and desktop editions only differ by the packages installed, and I can install server packages (LAMP etc.) into a desktop edition and get the same thing. However, I want to be able to completely change my desktop installation into a server edition. e.g: when I type uname -a or lsb_release -a it is supposed to say Ubuntu server or something. I currently have an 11.10 desktop installation with LAMP stack installed and the info displayed by apache is "Apache blah blah, on (Ubuntu) server. Where does apache get this information that I am using an Ubuntu desktop installation and not a server one? Is there a config file(s) to edit?

    Read the article

  • Setting up APACHE-JAMES Server

    - by venomrld
    I am trying to setup Apache-James Server on Ubuntu, in which I am getting the annoying error: JAVA_HOME not defined correctly We cannot execute I have already referred to the documentations and set up the PATH and JAVA_HOME variables correctly in the /etc/profile file. Upon calling echo, I get the values in the output screen. Where am I missing? echo $JAVA_HOME /usr/local/jdk1.6.0_27 echo $PATH $PATH:/usr/local/jdk1.6.0_27/bin Please Help !!

    Read the article

  • plesk + high POP3/IMAP traffic, how to check details?

    - by Danzzz
    Please check this image, it's a screenshot from plesk 10 of 1 domains mail traffic: This domain has about 1GB POP3/IMAP (OUT) traffic each day. I know that this is not normal because I know the owner and how he's using his mail. It's just some mails each day. Is OUT in this case incomming mails to the domain owner? or is it OUTgoing imap traffic? I have about 30 domains on this machine, but this one is the only one making so much traffic. How can I check whats happening there? Can I check which email adress makes the most of this traffic? Can I try to swich off Imap for just this domain?

    Read the article

  • How to to specify network address for a dhcp client

    - by drecute
    I have setup and configured a DHCP server on a sparc running Solaris 10. Now I want to test the DHCP server by creating a DHCP client on another computer running Solaris 11. I would like to know, how do I specify a network address for a dhcp client such that its generated ip address is within a specific subnet. For example: The DHCP server host = 172.1.1.1 So I want the client machine to have an IP Address in the range of 172.1.1.1 255.255.255.0. Please help me.

    Read the article

  • Two domains hosted on the same server with different root folder shows up the same homepage

    - by emaillenin
    I have hosted two domains from GoDaddy at Linode VPS. They are mobiletoast.com and lesseltechnologies.com Thought the latter site has a separate index folder, whenever I navigate to it, I get the homepage of mobiletoast.com The strange thing is, I see the expected page (It works), when I open the site from my mobile phone. But when I open the site from my PC (any browser, without any cache, hard refresh), I get the homepage of mobiletoast.com The Linode support team says, they see the correct "It works" page. But I am not able to see that page. This is the output of the command apache2ctl -S root@li339-83:~# apache2ctl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server mobiletoast.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost mobiletoast.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost blog.mobiletoast.com (/etc/apache2/sites-enabled/blog.mobiletoast.com:1) port 80 namevhost lesseltechnologies.com (/etc/apache2/sites-enabled/lesseltechnologies.com:1) port 80 namevhost mobiletoast.com (/etc/apache2/sites-enabled/mobiletoast.com:1) Syntax OK

    Read the article

  • ASP.NET sending email through exchange problem

    - by Solmead
    I have an exchange 2010 server running on Windows 2008 R2, I also have a remote webserver running Windows 2003 with multiple sites on it (all asp.net mvc 2 sites). I setup a Transport in exchange and all the websites on my remote web server can send email no problem to anyone in the exchange server and to any external domain. Now for my problem. I am having issues with that webserver, so I moved one of the websites to run on my exchange server, it runs well (low hit website) except that email doesn't work from that site. I tried changing the Transport in exchange to add the IP address of the local machine and the 127.0.0.1 addresses and it still isn't sending any email. Any ideas on how to get this working? The remote websites can still send email no problem, the version of the site that I had to move on the remote server can still email, but on the exchange server for that website email does not send. I would guess it is a Transport issue, since it is running on the same server a firewall shouldn't be the issue. I changed the smtp setting in web.config to localhost, and now I do receive email to my account on the exchange server, but I do not receive any emails on outside addresses. To add more description, this is a custom developed asp.net mvc 2 website. And no errors were being generated in the code when sending the email in either case.

    Read the article

  • Installing Bugzilla on Ubuntu 9.04 and Plesk

    - by makeflo
    Hey guys. I'm trying to install the latest Bugzilla version on my ubuntu server. (Want to use a subdomain like bugs.domain.com) I already installed all necessary perl modules and check_modules.pl doesn't show any errors. But when I'm running the testserver.pl script I get the following: TEST-OK Webserver is running under group id in $webservergroup TEST-FAILED Fetch of images/padlock.png failed I'm also not able to visit ANY file within the bugzilla folder from the browser. I'm always getting a 404 error. The bugzilla folder and all containing files are set to apache as the owner. I tried to enter the apache configuration form the installation guide in the http.include file of the domain and in the vhosts.conf file of the subdomain as well. I don't know what to do... Playing with plesks' suexecgroup doesn't bring any solution... I hope you can help me! Thanks in advance!

    Read the article

  • Dovecot not working pop3 with postfix

    - by samer na
    $ telnet localhost pop3 Trying ::1... Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused $ netstat -l tcp 0 0 *:www : LISTEN tcp 0 0 localhost.localdoma:ipp : LISTEN tcp 0 0 *:smtp : LISTEN tcp 0 0 localhost.localdo:mysql : LISTEN and nothing about dovecot in mail.log or mail.err when I run this service dovecot start I got start: Rejected send message, 1 matched rules; type="method_call", sender=":1.553" (uid=1000 pid=26250 comm="start) interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")) in dovecot.conf protocols = imap imaps pop3 pop3s disable_plaintext_auth = no log_timestamp = "%Y-%m-%d %H:%M:%S " mail_location = maildir:/var/spool/mail/%d/%n mail_access_groups = mail first_valid_uid = 106 first_valid_gid = 106 protocol imap { } protocol pop3 { listen=*:110 pop3_uidl_format = %08Xu%08Xv } protocol lda { postmaster_address = [email protected] mail_plugins = quota log_path = /var/log/dovecot-deliver.log info_log_path = /var/log/dovecot-deliver.log } auth default { mechanisms = digest-md5 plain passdb sql { args = /etc/dovecot/dovecot-mysql.conf } userdb sql { args = /etc/dovecot/dovecot-mysql.conf } user = root }

    Read the article

  • How to avoid index.php in Zend Framework route using Nginx rewrite

    - by Adam Benayoun
    I am trying to get rid of index.php from the default Zend Framework route. I think it should be corrected at the server level and not on the application. (Correct me if I am wrong, but I think doing it on the server side is more efficient). I run Nginx 0.7.1 and php-fpm 5.3.3 This is my nginx configuration server { listen *:80; server_name domain; root /path/to/http; index index.php; client_max_body_size 30m; location / { try_files $uri $uri/ /index.php?$args; } location /min { try_files $uri $uri/ /min/index.php?q=; } location /blog { try_files $uri $uri/ /blog/index.php; } location /apc { try_files $uri $uri/ /apc.php$args; } location ~ \.php { include /usr/local/etc/nginx/conf.d/params/fastcgi_params_local; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SERVER_NAME $http_host; fastcgi_pass 127.0.0.1:9000; } location ~* ^.+\.(ht|svn)$ { deny all; } # Static files location location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ { expires max; } } Basically www.domain.com/index.php/path/to/url and www.domain.com/path/to/url serves the same content. I'd like to fix this using nginx rewrite. Any help will be appreciated.

    Read the article

  • Trouble with datasource not being called from viewWillAppear

    - by user278859
    A little background. I have taken GCCalendar which only works in portrait orientation and extended it to work in landscape similar to how the iPhone's Calendar app works. I did this by duplicating the main view class and modifying it to work in landscape. So when the phone is in portrait orientation the CGCalendar is instantiated from the apps main view controller using the original portrait view class and when in landscape orientation using the new modified landscape view class. Most of the other classes in GCCalendar are shared without modification. A few had to be duplicated as well. I got it all working great except for an issue with the datasource. The datasource is called when the calendar is first loaded and each time the user changes the dates being viewed. Problem is I can't get the datasource call to work on the first call. I am stumped as it works fine in portrait orientation and I cannot find any difference between the 2 versions. Following is some of the code that shows how it gets to the datasource call the first time. Subsequent calls removes all the calendar subviews and instantiates them again with the new dates. The duplicated landscape class names end in LS. Otherwise as you can see they are identical. Does anyone has any idea of where else I might look to resolve this issue? Thanks, John -------------------------------- //App main view controller - (void)showLandscapeCalendar { GCCalendarLandscapeView *calendar = [[[GCCalendarLandscapeView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (void)showPortraitCalendar { GCCalendarPortraitView *calendar = [[[GCCalendarPortraitView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (NSArray *)calendarEventsForDate:(NSDate *)date{ //build and return the events array //this is the protocol datasource method //It is supposed to run every time the date changes in the calendar } ------------------------------- // GCCalendarLandscapeView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayViewLS *nextDayView = [[GCCalendarDayViewLS alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayViewLS - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { //** first time through the dataSource method does not run events = [dataSource calendarEventsForDate:date]; } ------------------------------- // GCCalendarPortraitView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayView *nextDayView = [[GCCalendarDayView alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayView - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { **//this one works every time events = [dataSource calendarEventsForDate:date]; }

    Read the article

  • mysql timeout - c/C++

    - by user1262876
    Guys i'm facing a problem with this code, the problem is the timeout by timeout i mean the time it takes the program to tell me if the server is connected or not. If i use my localhost i get the answer fast, but when i connect to outside my localhost it takes 50sc - 1.5 min to response and the program frezz until it done. HOw can i fix the frezzing, or make my own timeout, like if still waiting after 50sc, tell me connection failed and stop? please use codes as help, becouse i would understand it better, thanks for any help i get PS: USING MAC #include "mysql.h" #include <stdio.h> #include <stdlib.h> // Other Linker Flags: -lmysqlclient -lm -lz // just going to input the general details and not the port numbers struct connection_details { char *server; char *user; char *password; char *database; }; MYSQL* mysql_connection_setup(struct connection_details mysql_details) { // first of all create a mysql instance and initialize the variables within MYSQL *connection = mysql_init(NULL); // connect to the database with the details attached. if (!mysql_real_connect(connection,mysql_details.server, mysql_details.user, mysql_details.password, mysql_details.database, 0, NULL, 0)) { printf("Conection error : %s\n", mysql_error(connection)); exit(1); } return connection; } MYSQL_RES* mysql_perform_query(MYSQL *connection, char *sql_query) { // send the query to the database if (mysql_query(connection, sql_query)) { printf("MySQL query error : %s\n", mysql_error(connection)); exit(1); } return mysql_use_result(connection); } int main() { MYSQL *conn; // the connection MYSQL_RES *res; // the results MYSQL_ROW row; // the results row (line by line) struct connection_details mysqlD; mysqlD.server = (char*)"Localhost"; // where the mysql database is mysqlD.user = (char*)"root"; // the root user of mysql mysqlD.password = (char*)"123456"; // the password of the root user in mysql mysqlD.database = (char*)"test"; // the databse to pick // connect to the mysql database conn = mysql_connection_setup(mysqlD); // assign the results return to the MYSQL_RES pointer res = mysql_perform_query(conn, (char*) "SELECT * FROM me"); printf("MySQL Tables in mysql database:\n"); while ((row = mysql_fetch_row(res)) !=NULL) printf("%s - %s\n", row[0], row[1], row[2]); // <-- Rows /* clean up the database result set */ mysql_free_result(res); /* clean up the database link */ mysql_close(conn); return 0; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >